box-o-sand/cli/exercise_02/input_fromfile.pl
2011-01-06 22:36:11 -05:00

28 lines
310 B
Perl

#!/usr/bin/env perl
use strict;
use warnings;
use IO::File;
use File::Basename;
my $script = basename($0);
my $USAGE = <<USAGE
Usage: $script <infile>
USAGE
;
if (!defined $ARGV[0]) {
die $USAGE;
}
my $infile = $ARGV[0];
open(DAT, $infile) or die "$infile: $!";
print <DAT>;
close(DAT);
1;
__END__