So that if $something, it will sort the array in reverse, otherwise $sorter doesn't exist and it will sort the array default. Basically I want to use a variable as perl syntax.my $sorter; if ($something){$sorter='reverse';} foreach ($sorter sort @array ) { blah; }
In reply to Reverse sort array by rethaew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |