Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Crazy constant question...

by ikegami (Patriarch)
on Dec 15, 2010 at 21:08 UTC ( [id://877378]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @num_to_name;
    BEGIN {
    ...
        require constant;
        constant->import( $num_to_name[$_] => $_ ) for 0 .. $#num_to_name;
    }
    
  2. or download this
    my @num_to_name;
    BEGIN {
    ...
        require constant;
        constant->import({ map { $num_to_name[$_] => $_ } 0..$#num_to_name
    + });
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-18 14:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found