in reply to Re^2: split and capture some of the separators
in thread split and capture some of the separators

T'is a good point in the general case.

What about just

grep length, split...

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^4: split and capture some of the separators
by shemp (Deacon) on Oct 07, 2004 at 22:33 UTC
    If $_ is undef, you get the:
    Use of uninitialized value...

      Okay, same point though.

      grep{ defined && length } split ...;

      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon