in reply to Problem in Number Range

I'm nto sure what you are trying to do. If you're trying to extract the numbers, how about:

$str = "123-135, 111-119, 127-130, 140-145"; @nums = split(/\s*[-,]\s*/, $str);

or if you want to keep the pairs together:

$str = "123-135, 111-119, 127-130, 140-145"; @nums = map { [ split(/-/, $_) ] } split(/\s*,\s*/, $str);

Neither of the above validates. They assume the input is in the appropriate format.