use strict; my @array = (1, 2, 3); foreach my $item (@array) {} print($item); # Compile error. $item only in scope for loop.