use strict; use warnings; my @array=("ch1","ch11","ch2","ch5","ch55","ch16"); print join(' ', sort @array), "\n"; __END__ ch1 ch11 ch16 ch2 ch5 ch55