From f7bf6d38e6c02146876ae7b894823db01e87681a Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 6 Jan 2011 23:12:51 -0500 Subject: [PATCH] reading and writing file --- cli/ex03/rwfiles.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 cli/ex03/rwfiles.pl diff --git a/cli/ex03/rwfiles.pl b/cli/ex03/rwfiles.pl new file mode 100644 index 0000000..eaef5ec --- /dev/null +++ b/cli/ex03/rwfiles.pl @@ -0,0 +1,23 @@ +#!/usr/bin/env perl +use strict; +use warnings; + +use File::Basename; + +my $basename = basename($0); +my $USAGE = < +USAGE +; + +open(INFILE, '<', $ARGV[0]) or die "$USAGE\n$!"; +open(OUTFILE, '>', $ARGV[1]) or die "$USAGE\n$!"; + +foreach my $inline () { + print OUTFILE $inline; +} + + + +1; +__END__