Powered by Ajaxy
Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Perl: iterate over two lists simultaneously

Perl: iterate over two lists simultaneously
{filelink=14094}

# define two arrays
@tab_a = ( -1, 52, .5, 3.5 );
@tab_b = ( 0, 10, -5, 1 );
foreach $elem (@tab_a, @tab_b)    # iterate over the two arrays
{
    $elem *= 5;   # Multiply by 5 the values<span id="more-40"></span> ??of two arrays
}
# Display the result
print "@tab_a";
print "@tab_b";

Users who found this page were searching for:

  • perl iterate over pair of arrays
  • how to print two threads simultaneously in perl
  • perl iterate lists
  • iterate two files simultaneously java
  • perl system simultaneously
  • perl iterate over two lists
  • perl array of array iterating
  • foreach two list simultaneously
  • print 2 no. in java simultaneously
  • perl loop over 2 hashes simultaneously

No comments yet.

Leave a Comment