@arr - This is a global variable that is created when it is first encountered by the analyzer and then viewed in the entire package.
use warnings;
for (1..3) {
for ( qw(a b c) ) {
push @arr, $_;
}
}
print "@arr\n";
It prints
abcabcabc
This is one of the bad things about globals that they “emit” throughout the code.
With use strict;on we get
Possible unintended interpolation of @arr in string at scope.pl line 11.
Global symbol "@arr" requires explicit package name at scope.pl line 7.
Global symbol "@arr" requires explicit package name at scope.pl line 11.
Execution of scope.pl aborted due to compilation errors.
strict @arr , @arr , @arr ( , ).
my , , , . my , ( , ).
A my () , eval. , .
, .
, ( ), ( ). @arr, , .
Possible unintended interpolation of @arr in string at scope.pl line 11.
Name "main::arr" used only once: possible typo at scope.pl line 11.
main::arr , , .
my() perlsub.