Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 avoiding work at the Monastery: (10)
As of 2014-10-25 17:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (146 votes), past polls