Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-04-19 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who makes your decisions?







    Results (359 votes), past polls