in reply to Re^3: Replace a value with another value from the same array
in thread Replace a value with another value from the same array
No, it can be done in one pass quite easily — you might not even need to pass through the whole array once.
my ($xxy, $yyk); for (@$data) { $xxy = $_ if $_->{code} eq 'XXY'; $yyk = $_ if $_->{code} eq 'YYK'; if ($xxy && $yyk) { $yyk->{expdate} = $xxy->{expdate}; last; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Replace a value with another value from the same array
by huck (Prior) on May 09, 2017 at 21:49 UTC | |
by tobyink (Canon) on May 10, 2017 at 06:19 UTC | |
by huck (Prior) on May 10, 2017 at 06:51 UTC | |
by tobyink (Canon) on May 10, 2017 at 11:36 UTC |