Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: opened file being overwritten

by perishowl (Initiate)
on Dec 13, 2012 at 20:50 UTC ( [id://1008721]=note: print w/replies, xml ) Need Help??


in reply to Re: opened file being overwritten
in thread opened file being overwritten

still not working :(

#!/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 (my $line = <$fh>) { print $line; } }

Replies are listed 'Best First'.
Re^3: opened file being overwritten
by perishowl (Initiate) on Dec 13, 2012 at 20:59 UTC
    i get the warning readline() on unopened filehandle at file.pl line 21. so that would be my while loop while (<$fh>) { print $line; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1008721]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 03:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found