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:

  • iterate through 2 litsts perl
  • perl iterate over two lists
  • advance two arrays simultaneously
  • perl system simultaneously
  • print 2 no. in java simultaneously
  • how to iterate one array over another array
  • traverse three arrays simulatneously python
  • looping over two arrays perl
  • how to print two threads simultaneously in perl
  • perl iterate over pair of arrays

No comments yet.

Leave a Comment