#!/usr/bin/perl -w @t = qw( aaaa bbbb ccccccc dddddd ); # assumes $i is undef or == 0 @n = map {$i+=5." ".$_} @t; print map {$_."\n"} @n; #### #!/usr/bin/perl -w @t = qw( aaaa bbbb ccccccc dddddd ); $i = -1; # the 2nd semicolon is not required, but adds clarity @n = map {$i+=2; if ($i%5==0){$i+=2}; $i." ".$_} @t; print map {$_."\n"} @n; #### @newwords = map {$l % 5 == 0; $l," ",$_} @words;