Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: 'use subs' causes method to vanish

by chromatic (Archbishop)
on Feb 06, 2009 at 02:31 UTC ( #741772=note: print w/ replies, xml ) Need Help??


in reply to Re^4: 'use subs' causes method to vanish
in thread 'use subs' causes method to vanish

The subs pragma is fine. The fragile part of the code is the use of barewords.

You don't see any trouble in your single file because it's a single file. When you start exporting subs and pulling in classes and packages from other files, then life can get complicated. There are some seven to ten cases of bareword disambiguation in the Perl 5 lexer, and almost no one can enumerate all of them; the complexity of those heuristics and the fact that even experts have trouble remembering all of the ways things that go weird make me want to avoid them where possible.


Comment on Re^5: 'use subs' causes method to vanish
Re^6: 'use subs' causes method to vanish
by gnosti (Friar) on Feb 06, 2009 at 08:17 UTC
    And here I thought I was in a coding-style backwater 'cos of all the parentheses cluttering my code. I'll look at them with different eyes. Seems like avoiding use of barewords is a good topic for Modern Perl.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2014-12-17 22:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (38 votes), past polls