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?
shmem is an "instant asshole - just add alcohol" :-P
[james28909]: you guys/gals are awesome. thanks for the wisdom.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2018-05-20 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?