in reply to Re: Perl Optimization
in thread Perl Optimization
If you check the ref()-iness of $obj, you'll find that there isn't any at all. The appropriate value is copied into $obj on each run of the loop. I'm not at all sure what it is you're trying to solve with this, but if you need access to the key/value pair without the big, horrendous copy, maybe something like this:foreach my $obj (%{$href}) #here ^ is the copy
Hope you find this useful!foreach my $key (keys %{$href}) { #do what you need with $key and $href->{$key} }
~Cybercosis
nemo accipere quod non merere
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re: Perl Optimization
by tye (Sage) on Jun 01, 2001 at 21:29 UTC |