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

If you put a block around a file-scope lexical, it is not a file-scope lexical anymore. Writing the main code after subs are defined is another "just be careful" convention — it works (until the convention is broken), but if you do not accept conventions as legitimate solutions to problems with bareword filehandles, then why do you accept conventions as solutions to problems with lexicals?

The last issue of programmer ignorance is not a problem that can be solved by changing the language, only by educating the programmers about the language in which they write.

  • Comment on Re^9: Is there a problem with using barewords as filehandles ?

Replies are listed 'Best First'.
Re^10: Is there a problem with using barewords as filehandles ?
by LanX (Saint) on Jul 08, 2020 at 08:01 UTC
    > If you put a block around a file-scope lexical, it is not a file-scope lexical anymore.

    My point was that the scope of lexical variables can be easily limited.

    You can't our FHs to limit the scope so you'd need different packages.

    > only by educating the programmers about the language in which they write.

    Well we wouldn't need any other languages if programmers were educated enough to use assembler.

    FHs need a lot of extra technique, educating a new programmer about all the tricks needed takes a while, without extra benefit.

    Discouraging their use doesn't mean changing the language.

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

      Well we wouldn't need any other languages if programmers were educated enough to use assembler.

      It's a matter of productivity as well.

        > It's a matter of productivity as well

        That's what I tried to imply. :)

        BTW: You can be extremely productive in assembler with the right set of macros, but those macro sets finally evolve to a language like C.

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