in reply to Re: Re: Re: Re: Calling can method
in thread Calling can method
for $x ('main', undef, \1) { if (UNIVERSAL::can($x, 'can')) { # ok print "can can\n"; $x->can('foo'); print "\n"; } else { # error: Can't call method "can" on undefined value/unblessed refe +rence ... print "can't can\n"; eval { $x->can('foo') }; print "$@\n"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re: Calling can method
by tye (Sage) on May 30, 2001 at 22:25 UTC |