@file_data = map { $_->[0] } sort { $a->[$variable] cmp $b->[$variable] } map { [ $_, (split(/\|/)) ] } @file_data;