http://www.perlmonks.org?node_id=1032164


in reply to split tosses away empty components even with positive width separators?

The help for split say this, so I think it's expected behaviour (but it is very late here !)

If LIMIT is omitted (or, equivalently, zero), then it is usually treated as if it were instead negative but with the exception that trailing empty fields are stripped (empty leading fields are always preserved); if all fields are empty, then all fields are considered to be trailing (and are thus stripped in this case).
  • Comment on Re: split tosses away empty components even with positive width separators?

Replies are listed 'Best First'.
Re^2: split tosses away empty components even with positive width separators?
by wrog (Friar) on May 06, 2013 at 01:53 UTC
    Ah, I need to set LIMIT = -1. Thank you!