in reply to sorting and indicies

You're trying to sort on @a which doesn't exist, instead you need to sort on @list
use strict; my @list = (4,9,3); my @indicies = sort { $list[$a] <=> $list[$b] } 0 .. $#list; print "@indicies\n";
Note the use of strict on the first line as this is very important when learning your way around perl and beyond. For example if you'd used strict in your example you would've got an informative warning message telling you Variable "@a" is not imported and 3 error messages relating to variables not being full qualified.
HTH

_________
broquaint