In Perl, can refer to an array using its name? <p>I'm new to Perl and I understand you can call functions by name, like this: <code>&amp;$functionName();</code>. However, I'd like to use an array by name. Is this possible?</p> <p>Long code:</p> <pre><code>sub print_species_names { my $species = shift(@_); my @cats = ("Jeffry", "Owen"); my @dogs = ("Duke", "Lassie"); switch ($species) { case "cats" { foreach (@cats) { print $_ . "\n"; } } case "dogs" { foreach (@dogs) { print $_ . "\n"; } } } } </code></pre> <p>Seeking shorter code similar to this:</p> <pre><code>sub print_species_names { my $species = shift(@_); my @cats = ("Jeffry", "Owen"); my @dogs = ("Duke", "Lassie"); foreach (@&lt;$species&gt;) { print $_ . "\n"; } } </code></pre>