Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 romping around the Monastery: (5)
As of 2014-12-20 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (95 votes), past polls