Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

How to alias a whole namespace to another namespace (in this case main::)

by aufflick (Deacon)
on Nov 15, 2004 at 03:47 UTC ( #407763=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foo::bar {print "bar\n";}
    %main:: = (%main::, %foo::);
    bar();
    
  2. or download this
    sub foo::bar {print "bar\n";}
    foreach $name (keys %foo::) { 
        $main::{$name} = $foo::{$name};
    }
    bar();
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (1)
As of 2021-10-22 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?