Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: Re: Re: Context aware functions - best practices?

by MarkM (Curate)
on Jan 16, 2003 at 20:18 UTC ( #227480=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Re: Context aware functions - best practices?
in thread Context aware functions - best practices?

Perl 5.8.0 comes with Scalar::Util. One of the subroutines provided by this module is reftype(). reftype() is superior to UNIVERSAL::isa() in this context. For blessed or non-blessed array references, reftype() will always return 'ARRAY'.

Personally, I plan to use Scalar::Util::reftype() quite a bit in cases where I used to use UNIVERSAL::isa().

  • Comment on Re: Re: Re: Re: Re: Context aware functions - best practices?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Context aware functions - best practices?
by demerphq (Chancellor) on Jan 16, 2003 at 20:39 UTC
    Yup. Thats a good solution too. :-)

    Too bad it wasnt standard kit earlier on. In fact, too bad that reftype wasnt accepted as a pure perl keyword. Likewise for most of the modules contents.

    --- demerphq
    my friends call me, usually because I'm late....

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://227480]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2016-09-26 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (493 votes). Check out past polls.