Help for this page

Select Code to Download


  1. or download this
    $line = "foo  bar";
    print ++$i, ". $_\n" for split / /, $line;
    
  2. or download this
    split /\s+/, $line
  3. or download this
    $line = "  foo   bar  ";
  4. or download this
    split " ", $line
  5. or download this
    perl -MO=Deparse -e 'split " "'
    split(/\s+/, $_, 0);
    
  6. or download this
    perl -MO=Deparse -e 'split /\s+/'
    split(/\s+/, $_, 0);