Argel has asked for the wisdom of the Perl Monks concerning the following question:
Is there a better way to add $href to %tokens than dereferencing it and creating a new anonymous hash reference? Using Perl 5.8.0 on Solaris. Thanks!while( <$fd> ) { my $href = { map { split '=' } split ';' }; my $id = (split '\.', $href->{TOKEN})[1]; $tokens{$id} = { %{ $href } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Better way to add refs to an array or hash?
by cog (Parson) on Mar 25, 2005 at 00:39 UTC | |
by Argel (Prior) on Mar 25, 2005 at 00:56 UTC | |
|
Re: Better way to add refs to an array or hash?
by Tanktalus (Canon) on Mar 25, 2005 at 00:53 UTC | |
by Argel (Prior) on Mar 25, 2005 at 01:02 UTC | |
|
Re: Better way to add refs to an array or hash?
by Mugatu (Monk) on Mar 25, 2005 at 00:51 UTC | |
|
Re: Better way to add refs to an array or hash?
by gam3 (Curate) on Mar 25, 2005 at 00:54 UTC |