Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Can't call sub within same package in BEGIN block

by ikegami (Pope)
on Aug 14, 2014 at 16:08 UTC ( #1097437=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Can't call sub within same package in BEGIN block
in thread Can't call sub within same package in BEGIN block

What I still don't understand is why use subs lost this race.

It didn't. use subs did its thing before the BEGIN block was executed.

You're trying to execute "Test fine" before it even gets read from the source file by the parser!


Comment on Re^3: Can't call sub within same package in BEGIN block
Select or Download Code
Re^4: Can't call sub within same package in BEGIN block
by exilepanda (Monk) on Aug 14, 2014 at 23:26 UTC
    yeah.. I got it now.. use subs "_init" only declared the sub name, but _init() would only work when it's defined.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-09-20 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (158 votes), past polls