displaying input from file
This commit is contained in:
parent
1a904efe69
commit
0c61e4d061
27
cli/exercise_02/input_fromfile.pl
Normal file
27
cli/exercise_02/input_fromfile.pl
Normal file
@ -0,0 +1,27 @@
|
||||
#!/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__
|
Loading…
Reference in New Issue
Block a user