in reply to Re: Strange "undefined value as an ARRAY reference" error
in thread Strange "undefined value as an ARRAY reference" error
sub foo { my ($x) = @_; '' =~ /(?{ print "$x\n" })/; } foo('a'); foo('b');
Variable "$x" will not stay shared at (re_eval 1) line 2. a a
The warning was added in 5.10, but the problem has always existed.
However, the OP should have localized the variables. Bonus, this initializes @common_letters to ().
local our @common_letters; local our @wordsCopy = @words;
|
|---|