http://qs321.pair.com?node_id=11118757


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.