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

Perl: Iterating an Array Using the for Statement

Perl: Iterating an Array Using the for Statement
{filelink=14092}

#!/usr/bin/perl
@array = (1, 2, 3, 4, 5);
foreach $elem (@array)
{
    $elem--;
}
# print result
print "@array";

No comments yet.

Leave a Comment