MIME::Base64

Provides functions to encode and decode strings into the Base64 encoding scheme as specified in RFC 2045 (dealing with MIME, or Multipurpose Internet Mail Extensions). Base64 encoding was designed to represent data in octets in an encoded form; all data is encoded using a 65-character subset, which is comprised of A-Z, a-z, 0-9+, /, and =. MIME::Base64 ships with the Perl source kit as of 5.8.

For example:

#!/usr/local/bin/perl -w
use MIME::Base64;
my $stone = 'purplebarneystone';
my $b64 = encode_base64($stone);
print "$b64\n";

MIME::Base64 implements the following functions, both of which are exported.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.