/home/wpollock1/public_html/ShScript/filter.pl
#!/usr/bin/perl -TW
#
# filter.pl - This demo perl program shows how to read a filename
# from the command line, open the file for reading, do something
# to it (convert to all uppercase), and send the results to stdout.
# As an extra, notice how if no filename is supplied then STDIN
# is used instead.
#
# Written 3/2007 by Wayne Pollock, Tampa Florida USA
if ( @ARGV )
{ $filename = $ARGV[0];
} else {
$filename = "-";
}
open( FILE, "< $filename" ) or die "$filename: $!";
$filename = "STDIN" if ( $filename eq "-" );
print "filename: $filename\n";
while ( <FILE> )
{
tr/a-z/A-Z/;
print;
}
print "The end.\n";
close( FILE );