in reply to Re: opened file being overwritten
in thread opened file being overwritten
#!/bin/Perl use warnings; if (@ARGV < 4) { print ("you need to provide 4 arguments\n\t4th argument is file to + parse"); exit; } $fh = pop(@ARGV); 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,"<$fh" || die "could not open $fh"; while (<FILE4>) { print $_; } }
this makes no sense why the FILE4 file handle wont be printed i opened it for reading
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: opened file being overwritten
by 2teez (Vicar) on Dec 13, 2012 at 21:31 UTC | |
Re^3: opened file being overwritten
by Anonymous Monk on Dec 13, 2012 at 22:07 UTC |