in reply to "my" variables don't work with symbolic

<rant type="symbolic references">
Symbolic references are bad.
Don't use symbolic references.
use strict prevents you from using symbolic references for a good reason.
Read Dominus' article for more details on why symbolic references are a really bad idea.
</rant>

Do it like this instead:

my %list; $list{foo} = [1, 2, 3]; $list{bar} = [4, 5, 6]; my $src = 'foo'; my @list = @{$list{$src}}; print 'length = ', scalar @list, "\n"; # or... $src = 'bar'; print 'length = ', scalar @{$list{$src}}, "\n";
--
<http://www.dave.org.uk>

"Perl makes the fun jobs fun
and the boring jobs bearable" - me