use strict; use warnings; use vars qw($j); # or "our $j;" $j = $_ for (1 ..3); ($j) ? print $j : warn "no warnings - missing";