File: encode64.pl

package info (click to toggle)
openacs 5.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 54,632 kB
  • ctags: 13,474
  • sloc: sql: 116,618; tcl: 99,890; xml: 55,299; php: 4,780; sh: 2,385; perl: 1,194; java: 368; makefile: 124
file content (20 lines) | stat: -rw-r--r-- 333 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/local/bin/perl
#
# Encode a file from stdin as base64
#
# hqm@ai.mit.edu
#
# This script does the following:
#

use MIME::Base64 ();

binmode(STDIN);
binmode(STDOUT);
# Make sure to read in multiples of 6 chars, to
# keep the encoded blocks contiguous.
while (read(STDIN, $_, 60*1024)) {
  print MIME::Base64::encode($_);
}