in reply to Swapping Two Hash Values
which is easier on the eyes, and no temp variables.sub reorder { my ($item,$direction) = @_; if($direction eq 'up'){ @hash{$item,$item-1} = @hash{$item-1,$item}; } }
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Swapping Two Hash Values
by Cody Pendant (Prior) on May 28, 2003 at 00:47 UTC |