Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by aufflick (Deacon)
on Nov 15, 2004 at 05:18 UTC ( #407774=note: print w/replies, xml ) Need Help??


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

sub foo::bar {print "bar\n"} *{"main::"} = *{"foo::"}; bar();

Results in:

Modification of a read-only value attempted at - line 2.

And I want to add to main, not completely replace it.

Replies are listed 'Best First'.
Re^3: How to alias a whole namespace to another namespace (in this case main::)
by simonm (Vicar) on Nov 15, 2004 at 15:54 UTC
    Modification of a read-only value attempted

    Sorry, I'd never tried aliasing over main that way; I guess the root package name is more special than the others.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2021-10-27 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (94 votes). Check out past polls.

    Notices?