http://www.perlmonks.org?node_id=407774


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.