Joe Discenza wrote:
DZ-Jay wrote, on Mon 05-Dec-05 07:58
: I have a problem using the split() function: When there are trailing
: delimiters, without any content between them, split() skips them. For
From "perldoc -f split":
If LIMIT is specified and positive, splits into no more than
that many fields (though it may split into fewer). If LIMIT is
unspecified or zero, trailing null fields are stripped (which
potential users of "pop" would do well to remember). If LIMIT is
negative, it is treated as if an arbitrarily large LIMIT had
been specified.
Hence, if you use a negative LIMIT, you'll get all your trailing fields.
Remember, perldoc is your friend.
Thanks. I read and re-read that section in Camel book last week before
submitting my question, and for some stupid reason the part about
"trailing null fields are stripped", and negative LIMITs kept eluding
me. Weird. When pointed out by Andreas, I read it again and sure
enough, there it was! Sorry about it, and thanks to all of you who
helped :)
dZ.
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs