Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

How can I define arrays using foreach loop

by Anonymous Monk
on Jul 17, 2002 at 08:09 UTC ( [id://182354]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @thearray = (1, 4, 6)
    my $line = <INFILE>;
    ...
    foreach(my $i = 0; $i <= $#thearray; $i++)   {
      push @bigarray[$thearray[$i]], [$line, $column[$thearray[$i]];
    }
    
  2. or download this
    @array_1 = [$line, $column[1]]
    @array_4 = [$line, $column[4]]
    @array_6 = [$line, $column[6]]
    

Log In?
Username:
Password:

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

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

    No recent polls found