1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
split /PATTERN/,EXPR,LIMIT
split Splits the string EXPR into a list of strings and returns that
list. By default, empty leading fields are preserved, and empty
trailing ones are deleted. (If all fields are empty, they are
considered to be trailing.)
If LIMIT is specified and positive, it represents the maximum
number of fields the EXPR will be split into, though the actual
number of fields returned depends on the number of times PATTERN
matches within EXPR. 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. Note that
splitting an EXPR that evaluates to the empty string always
returns the empty list, regardless of the LIMIT specified. |