in reply to Assign in loop with and without declaration

because of scope, same as
my $i = undef; for(1..3){ $i = $_; } for(1..3){ my $j = $_; }