[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Omaha.pm] uuencode - C, Pascal, or Perl?
-laugh-
The GNU sharutils bundle has uuencode in it. uuencode is a handy tool
for emailing binary files to someone from the command line. It used
to be standard on *nix, but not so much any more.
Anyway, I think it's funny that the bundle lets you choose between 3
implementations:
313 lines of C
202 lines of Pascal
10 (actually 5) lines of Perl
:)
j
$ pwd
/home/jhannah/src/sharutils-4.6.3
wc -l
313 src/uuencode.c
10 contrib/uuencode.pl
202 contrib/uuencode.pas
$ cat contrib/uuencode.pl
# uuencode in Perl - non tested.
# Copyright (C) 1995 Free Software Foundation, Inc.
# Fran?ois Pinard <pinard@iro.umontreal.ca>, 1995.
print "begin 644 $ARGV[0]\n";
print pack ("u", $bloc) while read (STDIN, $bloc, 45);
print "`\n";
print "end\n";
exit 0;