Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The result is much different if the key itself contains a reference.
print ref( $key ) foreach $key (keys %hash);
<KBD>ref( $key ) </KBD>returns nothing if "$key" is in fact
a reference. So I have been
resorting to testing, say:
index($key, "SCALAR")
... which seems to border on downright cheesy. Is there some less
cheesy way
to make "$key" give up its little secret?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: If a hash key is a reference...
by btrott (Parson) on Jun 18, 2000 at 01:24 UTC | |
|
Re: If a hash key is a reference...
by cbraga (Pilgrim) on Jun 18, 2000 at 05:13 UTC |