Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

RE: RE: opening a file

by Shendal (Hermit)
on Nov 01, 2000 at 02:14 UTC ( #39339=note: print w/replies, xml ) Need Help??

in reply to RE: opening a file
in thread opening a file

Technically speaking, open does not require a filehandle and a filename. From the page you referred to:

Opens the file whose filename is given by EXPR, and associates it with FILEHANDLE. If FILEHANDLE is an expression, its value is used as the name of the real filehandle wanted. If EXPR is omitted, the scalar variable of the same name as the FILEHANDLE contains the filename. (Note that lexical variables--those declared with my()--will not work for this purpose; so if you're using my(), specify EXPR in your call to open.)

That said, it's rare/dangerous/not-a-good-idea to use this fuctionality. I'd recommend using the two-parameter form you describe.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2016-10-23 22:47 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.