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)
    }