in reply to How to generate 64-character length lines in base64?

Specify a blank eol character when you encode it, then break it up however you want.

Update: oops, removed bogus double quotes

use MIME::Base64; my $str = 'Whatever'; my $encoded = encode_base64($str, ''); $encoded =~ s/(.{1,64})/$1\n/g; print $encoded;

Replies are listed 'Best First'.
Re^2: How to generate 64-character length lines in base64?
by rmichael (Initiate) on Mar 19, 2013 at 16:31 UTC

    Thank you!

    I did wonder about this, but was unsure about '=' padding if/when required. encode with the default EOL would handle that for me, I believe. Perhaps breaking it up myself could necessitate change some line endings?

    I'll read a few more spec details and play with this.