Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Answer: Is there an isArray() in Perl?

by Flame (Deacon)
on Oct 16, 2001 at 00:33 UTC ( #118990=categorized answer: print w/replies, xml ) Need Help??

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

Try:
foreach $item (@array){ if(ref($item) eq 'ARRAY'){ #It's an array reference... #you can read it with $item->[1] #or dereference it uisng @newarray = @{$item} }else{ #not an array in any way... } }
Hope this helps

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 romping around the Monastery: (4)
As of 2020-10-27 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (256 votes). Check out past polls.

    Notices?