- or download this
perl -le '$_="2|3|||||"; @a = split /\|/; print scalar @a
2
- or download this
split Splits a string into a list of strings and returns
that list. By default, empty leading fields are
preserved, and empty trailing ones are deleted.
- or download this
perl -le '$_="2|3|||||"; @a = split /\|/, $_, 7; print scalar @a'
7