Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: VVP:arrays of the same size.

by dragonchild (Archbishop)
on Mar 20, 2002 at 20:40 UTC ( [id://153125]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    for (my $i = 0; $i < @a; $i++) {
        # Do stuff with @a and @b
    }
    
  2. or download this
    my %temp;
    @temp{@a} = @b;
    while (my ($a_val, $b_val) = each %temp) {
        # Do stuff with $a_val and $b_val
    }
    
  3. or download this
    use mapcar; # This is on a node [tye] posted somewhere on PM
    
    ...
    foreach my $vals (@temp_arr) {
        # Do stuff with $vals->[0] (from @a) and $vals->[1] (from @b)
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-24 18:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found