in reply to Passing a string to call an array?

Why? With the trivial sample code you've shown there is no compelling reason to do that.

In some cases it may be appropriate to use a hash of arrays and use 'HD' as a key to access the specific HD array. Consider:

my %arrays = (HD => [0.153488905, 0.153488905, 3.688879454]); my $testing = "HD"; print "@{$arrays{$testing}}";

prints:

0.153488905 0.153488905 3.688879454
True laziness is hard work

Replies are listed 'Best First'.
Re^2: Passing a string to call an array?
by pzj20012 (Initiate) on Oct 20, 2013 at 08:16 UTC
    thank you!