box-o-sand/cli/ex03/rwfiles.pl

24 lines
337 B
Perl
Raw Normal View History

2011-01-07 04:12:51 +00:00
#!/usr/bin/env perl
use strict;
use warnings;
use File::Basename;
my $basename = basename($0);
my $USAGE = <<USAGE
Usage: $basename <infile> <outfile>
USAGE
;
open(INFILE, '<', $ARGV[0]) or die "$USAGE\n$!";
open(OUTFILE, '>', $ARGV[1]) or die "$USAGE\n$!";
foreach my $inline (<INFILE>) {
print OUTFILE $inline;
}
1;
__END__