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

Re: Extract&Print row from two-dimensional array

by AnomalousMonk (Archbishop)
on Nov 09, 2010 at 22:56 UTC ( [id://870423]=note: print w/replies, xml ) Need Help??


in reply to Extract&Print row from two-dimensional array

Just to guild the lily of zentara's reply:

>perl -wMstrict -le "my @ra_2d = ( [ qw(a b c) ], [ qw(x y z) ], [ qw(p q r) ], ); ;; print join '-', $ra_2d[1] ; print join '-', @{ $ra_2d[1] }; ;; for my $arrayref_row (@ra_2d) { print join ':', @$arrayref_row; } " ARRAY(0xafc9dc) x-y-z a:b:c x:y:z p:q:r

See perlref, perlreftut, perllol, perldsc.

And, as always, Data::Dumper and its ilk help to visualize just what you're dealing with.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2026-01-17 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (121 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.