in reply to MIME::Base64 on win32 (Activestate 5.10) broken ?
use MIME::Base64 qw( encode_base64 decode_base64 ); open( INBIN, '<', 'file.png' ) or die "$!"; open( OUTB64, '>', 'file.b64' ) or die "$!"; binmode( INBIN ); while ( read( INBIN, $buf, 60 * 57 ) ) { print OUTB64 encode_base64( $buf ); } close ( INBIN ); close ( OUTB64 ); open( OUTBIN, '>', 'out.png' ) or die "$!"; open( INB64, '<', 'file.b64' ) or die "$!"; binmode( OUTBIN ); while ( <INB64> ) { print OUTBIN decode_base64( $_ ); } close ( OUTBIN ); close ( INB64 );
I am curious what exactly is different about your ActiveState 5.10.0 and these other installations. What's your MIME::Base64 version? What's your Windows version? Are you using anything else in the mix like Windows-to-Unix compatibility tools or anything?
|
|---|