Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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]
NodeReaper stumbles on his way to the attic

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2017-06-24 07:44 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (557 votes). Check out past polls.