in reply to Re: Using split() to divide a string by length
in thread Using split() to divide a string by length

Your grep should be grep { defined }.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart

Replies are listed 'Best First'.
Re^3: Using split() to divide a string by length
by Zaxo (Archbishop) on Apr 13, 2006 at 20:58 UTC

    Yep, I tried with defined first because that's the way I thought it worked, too. With that, the result of mine is,

    abc def ghi jkl mno pqr stu vwx yz
    Note the extra spaces, indicating that there are defined empty strings instead of undefs in those positions.

    Update: Good idea, ikegami++.

    After Compline,
    Zaxo

      Then grep length, ... is needed.