Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by LanX (Cardinal)
on Jul 01, 2020 at 10:57 UTC ( #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 (Chancellor) 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 (Pope) 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
Node Status?
node history
Node Type: note [id://11118757]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2020-08-05 05:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which rocket would you take to Mars?










    Results (35 votes). Check out past polls.

    Notices?