Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

RE: RE: opening a file

by Shendal (Hermit)
on Nov 01, 2000 at 02:14 UTC ( [id://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.

Cheers,
Shendal

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found