#!perl use strict; my $confs = 'B001, B003, B002'; my @confs = split /, /,$confs; my @sortedconfs = sort {$a cmp $b} @confs; print "@sortedconfs\n";