Gene Mat wrote:
> Hi I trying out a new module. Everything is working execpt I can seem to
> list out a reference hash to an array. How can I print out the contents of
> the array?
>
> I am able to get the all the keys of refrence hash by just using a
>
> foreach tag (keys %$REFHASH) {"print $tag $tag{$REFHASH}";}.
I'm hoping you mean
use strict;
my $refhash;
foreach my $tag (%$refhash) {
print $tag, $refhash->{$tag};
}
which is very different!
>
> At this point, I believe I need another nested foreach loop to loop through
> array, however, I'm totally confused on how to format this properly.
It sounds like each hash element's value is an array reference, in which case
it's probably easiest to extract each one into a real array to may it
obvious what's happening. Like this
use strict;
foreach my $tag (%$refhash) {
my $refarray = $refhash->{$tag};
my @value = @$refarray;
print "$tag => [EMAIL PROTECTED]";
}
HTH,
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]