Perl in a Nutshell says:
"If limit is specified and is not negative, the function splits into no more
than that many fields. If limit is negative, it is treated as if an
arbitrarily large limit has been specified. If limit is omitted, trailing
null fields are stripped from the result (which potential users of pop would
do well to remember). If limit is specified and is not negative, the
function splits into no more than that many fields. If limit is negative, it
is treated as if an arbitrarily large limit has been specified. If limit is
omitted, trailing null fields are stripped from the result (which potential
users of pop would do well to remember)."
It sounds as if you want to set a negative limit, so that you get all the
fields that exist without restricting their number in the way that a
positive limit might.
HTH,
Andrew.
----- Original Message -----
From: "Paul Makepeace" <[EMAIL PROTECTED]>
To: "London.pm" <[EMAIL PROTECTED]>
Sent: Saturday, December 02, 2000 12:52 AM
Subject: split() question
> =item split /PATTERN/,EXPR
>
> Splits a string into an array of strings, and returns it. By default,
> empty leading fields are preserved, and empty trailing ones are deleted.
>
> =cut
>
> Is there some way to preserve trailing empty fields without explicitly
> setting a LIMIT? (I would like to do this so I can check that a file has
> the right number of fields (i.e. whether it's corrupt or not).)
>
> Paul