Help for this page

Select Code to Download


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