“
To base64-encode the whole file, use this: perl -MMIME::Base64 -0777 -ne 'print encode_base64($_)' file Here, the -0777 argument together with -n causes Perl to slurp the whole file into the $_ variable. Next, the file is base64-encoded and printed. (If Perl didn’t slurp the entire file, it would be encoded line by line, and you’d end up with a mess.)
”
”