in reply to Readonly error on $_
But it's probably simpler to usesub selfcontrol { my $self = shift; defined $_ and length $_ and not (/REF/ or /SCALAR/ or /ARRAY/ or /HASH/ or /CODE/ or /GLOB/) a +nd return $_ for ref $self; carp "diem"; }
sub selfcontrol { my $self = shift; return $self if eval {$self->can("can")}; # Only objects can dance! carp "diem"; }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Readonly error on $_
by jeroenes (Priest) on Jan 06, 2001 at 02:02 UTC | |
|
(tye)Re: Readonly error on $_
by tye (Sage) on Jan 11, 2001 at 19:38 UTC |