professa has asked for the wisdom of the Perl Monks concerning the following question:
my @file = <filehandle>; my $line = join "", @file; my $results = eval ($line);
I can access values (using a reference to that hash) when I manually look for a key in the file and use it in my code:
$test = $$results{"key"};
The problem is that I don't know the keys of that hash when reading from file since it's built at runtime with changing keys/values.
I can't get the keys by using each(), keys() or values() since these don't like references it seems.
Is there a possibility to evaluate that hash from the file to a real hash, or is there any way to get the keys from that dereferenced hash?
TIA, Michael
PS. My apologies for posting that topic before as anonymous, I forgot to enable cookies... ;-)
davorg: fixed code tags
|
|---|