use strict; my @dat=[qw(foo bar)]; for (@dat){ push (my @u, [$_->[0], $_->[1]]); 'foobar'=~/foo(?{ push (@u, [$_->[0], $_->[1]]) })/ } Can't use string ("foobar") as an ARRAY ref while "strict refs" in use at (eval 25)[/usr/share/perl5/core_perl/perl5db.pl:741] line 2. #### use strict; my @dat=[qw(foo bar)]; for (@dat){ push (my @u, [$_->[0], $_->[1]]) }