Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: scope and declaration in local packages

by december (Pilgrim)
on Jan 31, 2011 at 13:14 UTC ( #885266=note: print w/replies, xml ) Need Help??


in reply to Re: scope and declaration in local packages
in thread scope and declaration in local packages

The initialisation of the variables happens at runtime (execution of the block), while the setting up of the subroutines happens at compile-time.

That explains my confusion as to why Perl doesn't complain about the functions but can't find the variables. Thanks!

The reason I'm not calling new is that I would like to encapsulate a regex (and relevant condition) inside the object which should work without actually creating an instance. I just want to store that regex in the object for cleanliness, apart from any actual OO code.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2023-03-30 18:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (74 votes). Check out past polls.

    Notices?