Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Only last record is written to the output file instead of all records

by jwkrahn (Abbot)
on Nov 17, 2008 at 09:30 UTC ( [id://724024]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Only last record is written to the output file instead of all records
in thread Only last record is written to the output file instead of all records

Better to use fileno to test filehandles as a filehandle can be defined and closed:

$ perl -le' print defined $FH ? "defined" : "not defined"; print fileno $FH ? "open" : "not open"; open my $FH, "<", "test.txt" or die "test.txt: $!"; print defined $FH ? "defined" : "not defined"; print fileno $FH ? "open" : "not open"; close $FH; print defined $FH ? "defined" : "not defined"; print fileno $FH ? "open" : "not open"; ' not defined not open defined open defined not open
  • Comment on Re^4: Only last record is written to the output file instead of all records
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found