That's a feature called auto-vivification. Consider the following alternative:
print "this won't be printed\n" if (scalar @{$test} and scalar @{$test +}[0]);
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
In reply to Re: Why will referencing an undefined value as array reference create a real array
by jeffa
in thread Why will referencing an undefined value as array reference create a real array
by mfort
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |