in reply to How to sort?

use Sort::Key qw(keysort); my @data = <>; my @sorted = keysort { (split /\s+/, $_, 2)[1] } @data; print @sorted;