Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: File Handles

by rodion (Chaplain)
on Mar 08, 2007 at 08:21 UTC ( [id://603782]=note: print w/replies, xml ) Need Help??


in reply to Re: File Handles
in thread File Handles

Using scalars for file handles came in with 5.6.1 as well, and yes, it is encouraged. Note that it requires that the variable be uninitialized. It makes it much easier to put file handes in an array or a hash.

I don't have my 3rd Edition of the Camel book here at home, but I'm pretty sure it's in there, although it's not in the 2nd edition. (The third edition is considerably larger, to accomodate the many additions to perl.)

The "perldoc perl561delta" command I mentioned previously gives this information as well, just ahead of the paragraph about 3-argument open(). It's also on the web at File and directory handles can be autovivified. It's nicely described with a concise example.

Using "open delta" as the search string at Perl documentation is an alternative to the "grep" method mentioned in my previous post. The header at that link says its 5.8 documentation, but the previous deltas are included. Searching the web version gives you an interface that's a lot prettier than what you get grepping the text of the perl docs, but the web interface doesn't show you the context lines in each file, so you can't go to the document you want as fast. I find both approaches helpful, for different needs, but either interface will do the job, according to your preference.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found