in reply to Passing hash names in a file

Update: As jdporter mentioned above, there needs to be another level of abstraction - using the words as the name of each hash is polluting the namespace and asking for trouble.

That being said, are you already reading this information into a hash? If so, keys is what you need.

If you aren't already populating a hash with this, something like this should get you started:

#!/usr/bin/perl use strict; use warnings; my @keys; { my $glossary = 'gloss'; #filename containing the hash package Glossary; do $glossary or die "Error doing $glossary: $!"; @keys = keys %Glossary::; } print join "\n", @keys;

Note - if the file contains malicious code, it will be executed. If you use this in production, use Safe.pm and rdo to allow only trusted code to execute.