summaryrefslogtreecommitdiff
path: root/ext/MIME/Base64/encode-base64
blob: 0ee70f87e30bd2d5728c3cb2d5266b910460d6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl

use MIME::Base64 qw(encode_base64);

my $buf = "";
while (<>) {
    $buf .= $_;
    if (length($buf) >= 57) {
	print encode_base64(substr($buf, 0, int(length($buf) / 57) * 57, ""));
    }
}

print encode_base64($buf);