I just wonder since, after all, it does what I mean without warnings and my
Because without strict and warnings, the variable is a package variable, not a lexical variable. The strict version of your last example would be:
use strict; use warnings; use vars qw($j); # or "our $j;" $j = $_ for (1 ..3); ($j) ? print $j : warn "no warnings - missing";
In reply to Re: Assign in loop with and without declaration
by runrig
in thread Assign in loop with and without declaration
by andreas1234567
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |