in reply to Re: Re: undefining one slot of a typeglob
in thread undefining one slot of a typeglob
And I make this:undef *{$glob}{$type} ;
Not to remove the element from the GLOB, but to ensure that it goes out of the memory, since undef *{$glob} already remove all the keys/elements. Actually for your needs you can remove all the if ( $type eq '...' ).if ($type eq 'SCALAR') { undef ${*{$glob}} ;} elsif ($type eq 'ARRAY') { undef @{*{$glob}} ;} elsif ($type eq 'HASH') { undef %{*{$glob}} ;} elsif ($type eq 'CODE') { undef &{*{$glob}} ;} elsif ($type eq 'IO') { close *{$glob} ;}
Graciliano M. P.
"Creativity is the expression of the liberty".
|
---|