making a copy for fake greppery
This commit is contained in:
parent
ae1b4b1a0d
commit
95d7f5273f
23
cli/ex03/rwfakegrep.pl
Normal file
23
cli/ex03/rwfakegrep.pl
Normal file
@ -0,0 +1,23 @@
|
||||
#!/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__
|
Loading…
Reference in New Issue
Block a user