in reply to Referencing the locals

Hi. First, use strict and warnings and see what happens, then never turn them off again.

Second, don't use "a" or "b" as variable names. They are special.

For your stated objective:

my @cat=(1,2,3); my @dog=(5,6); my @pig=(4,3,2,1); for(\@cat,\@dog,\@pig){ stuff($_); # stuff() gets an arrayref and will need to dereference + it }

Hope this helps!


The way forward always starts with a minimal test.