in reply to Parsing a string for sorting
my $value = "001003051"; my $three; my $start = 0; while ($three = substr $value, $start, 3) { ## Do validation check on $three break unless is_good($three); $start += 3; } [download]