Help for this page

Select Code to Download


  1. or download this
    my @nums;
    push @nums, pos() - 1 while m/-[^-]/g;
    
  2. or download this
    my @nums;
    push @nums, pos() - 1 while m/- /g;
    
  3. or download this
    my (@nums, $pos);
    push @nums, $pos while $pos = index($_, '- ', $pos) + 1;
    
  4. or download this
    $_ = '   ----------  -------------------------  --------  ----  ------
    +-------------------  -----  ----  -----------  -----------';
    $_ .= ' ';
    ...
    push @nums, $pos while $pos = index($_, '- ', $pos) + 1;
    print join(' ', @nums);
    chop;