Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^2: globbing filehandles in arrays

by why_bird (Pilgrim)
on Jan 26, 2009 at 08:35 UTC ( #738879=note: print w/replies, xml ) Need Help??

in reply to Re: globbing filehandles in arrays
in thread globbing filehandles in arrays

You're using 3-arg open which was introduced at the same time as lexical file handles, so it's not a backwards compatibility issue.

Wow, I have to say I'm surprised that I really didn't know about something as basic as that!! Just goes to show what perlmonks can teach you. Strange also because I've found the global non-lexical file handles a real pain in the past and have never realised you could do it like that. I consider myself well and truly corrected (and pleased!)

For future reference, here is the (most?) relevent perldoc documentation, which strangely I hadn't come across (or perhaps rather read thoroughly) before. Also, perlopentut says the above explicitly, which I notice now that I come to look for it!

It still seems to be true though that the vast majority of examples in open and perlopentut are given using those old global filehandles, which I find a bit strange if it's not 'recommended' behaviour (I would certainly not recommend it!). Is this just because the documentation is old, or is there another reason?

Those are my principles. If you don't like them I have others.
-- Groucho Marx

Replies are listed 'Best First'.
Re^3: globbing filehandles in arrays
by ikegami (Patriarch) on Jan 26, 2009 at 13:54 UTC

    Probably just because noone got around to doing it ...until recently. It's finally been fixed in bleed (5.12 to be) and backported to maint-5.10 (5.10.1 to be).

    There's still lots of example with non-lexical file handles if you're looking for something to do :)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2023-03-28 21:54 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (69 votes). Check out past polls.