http://qs1969.pair.com?node_id=1008712

perishowl has asked for the wisdom of the Perl Monks concerning the following question:

ok this program isnt finished, why isnt the filehandle FILE4 being printed out, instead it just erases or overwrites the file being opened

#!/bin/Perl if (@ARGV < 4) { print ("you need to provide 4 arguments\n\t4th argument is file to + parse"); exit; } openfile(@ARGV); sub openfile { open FILE1,">$_[0]" || die "could not open $_[0]"; open FILE2,">$_[1]" || die "could not open $_[1]"; open FILE3,">$_[2]" || die "could not open $_[2]"; open FILE4,"$_[3]" || die "could not open $_[3]"; } while (my $line = <FILE4>) { print $line; }