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

Re: Multidimensional Array Iteration?

by glenn (Scribe)
on Aug 23, 2013 at 19:43 UTC ( [id://1050722]=note: print w/replies, xml ) Need Help??


in reply to Multidimensional Array Iteration?

my @qb; foreach my $position ("qb","rb","wr") { my @data = #query database; for (my $d = 0; $d < @data; $d++) { if ($position eq "qb") { my @temp = ($data[$d], $data[$d+1], $data[$d+2]); push (@qb,@temp); #--or-- push (@qb,($data[$d], $data[$d+1], $data[$d+2])); #--or-- push (@qb,[$data[$d], $data[$d+1], $data[$d+2]]); $d+=4; } } } foreach my $player (@qb) { print $@player[0] $@player[1] $@player[2]; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 16:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found