in reply to Re^2: using sub routines and solving an issue i have with passing variables
in thread using sub routines and solving an issue i have with passing variables

That won't work under use strict;, and for very good reasons: How can I use a variable as a variable name? and Why it's stupid to `use a variable as a variable name'.

If you really needed this type of functionality, you could use hashes of arrays instead, see e.g. perldsc along with perlreftut and perlref.

use warnings; use strict; my %data; my $string = "awesome_array"; my $other_string = "another_awesome_array"; push @{$data{$string}}, 1, 2, 3, 4, 5; foreach my $element (@{$data{awesome_array}}) { print "$element\n"; push @{$data{$other_string}}, $element; } print @{$data{another_awesome_array}};