Note that your second example doesn't test for an object but for an object or a package name and Perl considers most strings that don't contain control characters to be package names. This is easy to fix:
- tye (but my friends call me "Tye")sub selfcontrol { my $self = shift; return $self if ref($self) && eval {$self->can("can")}; carp "diem"; }
In reply to (tye)Re: Readonly error on $_
by tye
in thread Readonly error on $_
by jeroenes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |