## using a modified Schwartzian Transform, called the GSR sort... my @result = map { join "/", (/(....)(..)(..)/)[1,2,0]; } sort map { sprintf "%04d%02d%02d", (split /\//)[2,0,1]; } @input;