Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 contemplating the Monastery: (3)
As of 2014-09-21 23:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls