Isn't that supposed to be: @sorted = sort byID @master_lines; instead of @sorted = @master_lines[ sort byID 0..$#ids ]; ????? ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch