Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: BEGIN block and failure to initialize constants

by tobyink (Abbot)
on Sep 17, 2012 at 22:10 UTC ( #994126=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    print "World\n";
    BEGIN { print "Hello " };
    
  2. or download this
    package mylib;
    use constant {
    ...
        CONF_PATH   => do { $_ = __FILE__; s/pm$/conf/i; $_ },
    };
    print CONF_PATH;
    
  3. or download this
    package mylib;
    use constant {
    ...
        CONF_PATH   => (__FILE__ =~ s/pm$/conf/ir),
    };
    print CONF_PATH;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-07-03 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (48 votes), past polls