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
In reply to Re: Swapping Two Hash Values
by Enlil
in thread Swapping Two Hash Values
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |