Я пытаюсь использовать хеш-ссылки для передачи информации в подпрограммы. Код Псуэдо:
sub output_detail {
Here I want to be able to access each record by the key name (ex. "first", "second", etc)
}
sub output_records {
I want to use a foreach to pass each record has reference to another sub-routine
that handles each record.
foreach $key ( sort( keys %someting) ) {
output_detail(something);
}
}
%records = ();
while ($recnum, $first, $second, $third) = db_read($handle)) {
my %rec = ("first"=>$first, "second"=>$second, "third=>$third);
my $id = $recnum;
$records{$id} = \%rec;
}
output_records(\%records);
Я не уверен, как отменить ссылку на хэши при передаче в подпрограмму.
Любые идеи будут очень полезны.
Спасибо