#!/usr/bin/perl -w #Author: Aaron Burgemeister #E-mail: ab@novell.com, dajoker@gmail.com #Version: 0.1.20090928170000Z #Description: Utility to convert base64-encoded input to hexadecimal output. use MIME::Base64; my($base64Val) = ''; my($byteVal) = ''; my(@hexArr) = (); my($hexVal) = ''; if(scalar(@ARGV) == 0) { print STDERR 'Getting the base64 value from STDIN...' . "\n"; $base64Val = ; }#End if else { $base64Val = $ARGV[0]; } print STDERR 'Value found: ' . $base64Val . "\n"; $byteVal = decode_base64($base64Val); $hexArr = unpack 'H*', $byteVal; $hexVal = join ' ', $hexArr =~ /../g; print $hexVal . "\n";