http://qs321.pair.com?node_id=1011


in reply to File Input and Output Exercises

# takes two command line arguments for the source and # destination files, respectively. Then copies the contents # from the source file to the destination file. my $source = $ARGV[0]; my $dest = $ARGV[1]; unless ( $source and $dest ) { print "Source or destination file name missing\n"; } open SOURCE, "< $source" or die "error reading $source - $!"; open DEST, "> $dest" or die "error writing $dest - $!"; while ( <SOURCE> ) { print DEST $_; } close SOURCE; close DEST;