F
Fred S
Hi,
I have a hash containing, data, everything is generated on the fly so
my hash, has some scalars, and some arrays, in it.
How can I test wether a value of the hash is an array and then loop
through it ?
i did the following loop:
it will print the arrays but will skip the scalars,
foreach (keys %Options){
print $_." => \n";
foreach my $val (@{$Options{$_}}){
print "\t".$val;
print "\n";
}
}
Thanx for the help.
Fred
I have a hash containing, data, everything is generated on the fly so
my hash, has some scalars, and some arrays, in it.
How can I test wether a value of the hash is an array and then loop
through it ?
i did the following loop:
it will print the arrays but will skip the scalars,
foreach (keys %Options){
print $_." => \n";
foreach my $val (@{$Options{$_}}){
print "\t".$val;
print "\n";
}
}
Thanx for the help.
Fred