Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Answer: Is there an isArray() in Perl?

by jdporter (Canon)
on Mar 03, 2008 at 15:49 UTC ( #671669=categorized answer: print w/replies, xml ) Need Help??

Q&A > arrays > Is there an isArray() in Perl? - Answer contributed by jdporter

The reftype function in module Scalar::Util is good. It returns 'ARRAY' for any array reference, even if it's blessed.

Replies are listed 'Best First'.
Re: Answer: Is there an isArray() in Perl?
by swampyankee (Parson) on Mar 03, 2008 at 17:09 UTC

      Right. That makes it inappropriate as an isArray function, since it returns false for some arrays.

Re: Answer: Is there an isArray() in Perl?
by naikonta (Curate) on Mar 06, 2008 at 17:04 UTC
    If you work with normal array variables (not a reference ones), then you will never need such function. The sigil @ tells your right away that it's an array.

    Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2020-10-21 07:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (212 votes). Check out past polls.

    Notices?