Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how to dereference anonymous array

by zentara (Archbishop)
on Oct 18, 2011 at 17:58 UTC ( #932209=note: print w/replies, xml ) Need Help??


in reply to how to dereference anonymous array

This is a brute force approach, there may be more elegant ways.
#!/usr/bin/perl #How can I dereference and print this one: my @my_array_reference2 = ( 'BLACK', [qw(blue green red yellow)] ); foreach (@my_array_reference2) { if (ref $_ eq 'ARRAY'){print "@$_"} else {print "$_\n"} };

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932209]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-01-20 15:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (227 votes). Check out past polls.

    Notices?