in reply to using hash key as hash value ...
If you actually want one key of a hash to be an alias to another key, you'll have to do some tie() magic.$_ = "a:default:value" for @hash{'key1', 'key2', 'key3'}; # or $hash{$_} = "a:default:value" for 'key1', 'key2', 'key3'; # or @hash{'key1', 'key2', 'key3'} = ("a:default:value") x 3;
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: using hash key as hash value ...
by blueflashlight (Pilgrim) on Oct 02, 2001 at 07:10 UTC |