in reply to Converting String Containing Ranges to Array
eval?
perl -wle "print for eval shift" 1,5,7..10,15,17..19,22 [download]
There also is a node somewhere on here, where this issue is discussed further, but I can't find it currently.