Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Writing to an output file

by 1nickt (Canon)
on Apr 17, 2019 at 21:18 UTC ( [id://1232732]=note: print w/replies, xml ) Need Help??


in reply to Writing to an output file

Hi,

open(FH, '<', $filename) or die ...

Better written as

open(my $IN_FH, '<', $filename) or die ...; while (<$IN_FH>) { ... }

So, if "<" is the second arg for when you want to read from a file ...

See (please, for goodness' sake, see) https://perldoc.perl.org/perlintro.html#Files-and-I%2fO


The way forward always starts with a minimal test.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-20 00:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found