in reply to undef Package;

undef the package array hash:

undef %{"${package}::"}


(And thanks to Juerd for deconfusing me about arrays and hashes)

Replies are listed 'Best First'.
Re: Re: undef Package;
by Juerd (Abbot) on Apr 03, 2002 at 11:46 UTC

    undef the package array

    I have already tried that, but it does not work.

    package Foo; sub subroutine { 'Package "' . __PACKAGE__ . '"' } $variable = "is still there.\n"; package main; undef %Foo::; print join ' ', Foo::subroutine, $Foo::variable;
    By the way, it's a hash :)

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk