in reply to sorting a file

Real life scenarios often don't permit just splitting to find out the first and last names. Anyway, here's my try:
perl -le'print join ", ", @$_ for sort { $a->[0] cmp $b->[0] } map [re +verse split], <>'