c:\@Work\Perl\monks>perl -le "use strict; use warnings; ;; our $x = 'x before loop'; print qq{before loop: '$x'}; ;; for my $i (1 .. 2) { our $x = 'x in loop'; print qq{in loop: iteration $i: '$x'}; } ;; print qq{after loop: '$x'}; " "our" variable $x redeclared at -e line 1. (Did you mean "local" instead of "our"?) before loop: 'x before loop' in loop: iteration 1: 'x in loop' in loop: iteration 2: 'x in loop' after loop: 'x in loop'