in reply to Re^2: Using a scalar as an array name
in thread Using a scalar as an array name
Then why don't you use a hash too? which holds the keyword and the associated array? So you can limit the access?
Something like:
my %array_references = (myarray => \@MyArray, second_array => \@anothe +r-array);
And somewhere else in your script:
my $reference = $array_references{lc $input}; print $reference->[0]; # (for example)
This gives you a higher control on what the world can access, and allows you to run the script under 'use strict'
|
|---|