Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Is there a problem with using barewords as filehandles ?

by LanX (Saint)
on Jul 01, 2020 at 10:57 UTC ( [id://11118757]=note: print w/replies, xml ) Need Help??


in reply to Re: Is there a problem with using barewords as filehandles ?
in thread Is there a problem with using barewords as filehandles ?

> Bareword filehandles are essentially global

Sorry for nitpicking but they are package variables not full globals.

Conflicts can be avoided with proper use of package directives.

Special variables are real globals, they are available everywhere but always belong to main:: package (IIRC)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^3: Is there a problem with using barewords as filehandles ?
by hippo (Bishop) on Jul 01, 2020 at 11:34 UTC
    Sorry for nitpicking but they are package variables not full globals.

    No need to be sorry! You are quite correct and it's an important distinction. It has been so long since I actually used a user-defined bareword filehandle that I had forgotten that they are indeed package scoped.

Re^3: Is there a problem with using barewords as filehandles ?
by ikegami (Patriarch) on Jul 19, 2020 at 11:59 UTC

    Package variables *are* global (visible everywhere).

        Except it's always visible. Yes, you can only use its abbreviated name in some places. So? That doesn't reduce its scope.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-23 14:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found