my @squares = (1, 2, 3, 4, 5); # Those aren't squares! foreach $i ( @squares ) { $i = $i * $i; } # Oh yes they are... print join ", ", @squares;