in reply to Base64 encode and decode

Play with this, do you really need a 1-liner?
#!/usr/bin/perl use strict; use MIME::Base64 qw( encode_base64 ); #encode open INFILE, '<', $ARGV[0]; binmode INFILE; open OUTFILE, '>', $ARGV[1]; my $buf; while ( read( INFILE, $buf, 4096 ) ) { print OUTFILE encode_base64($buf); } close OUTFILE; close INFILE; ################################################### #decode_base64.pl: #!/usr/bin/perl use strict; use MIME::Base64 qw( decode_base64 ); open INFILE, '<', $ARGV[0]; open OUTFILE, '>', $ARGV[1]; binmode OUTFILE; my $buf; while ( $buf = <INFILE> ) { print OUTFILE decode_base64($buf); } close OUTFILE; close INFILE;

I'm not really a human, but I play one on earth My Petition to the Great Cosmic Conciousness

Replies are listed 'Best First'.
Re^2: Base64 encode and decode
by gio001 (Acolyte) on Feb 26, 2009 at 15:34 UTC
    Thanks, these work great!.
    your help was greatly appreciated