Paul Lalli wrote:
Annoyingly, split / /, $foo; and split ' ', $foo; are not the same thing. split ' ', $foo is a special case that means to split on all sequences of whitespace. It means the same thing as split /\s+/, $foo;

Not quite Paul. From perldoc -f split:

 A "split" on "/\s+/" is like a "split(' ')" except that any leading
 whitespace produces a null first field.

so ' ' splits at the same places as /\s+/, but also omits any leading
empty fields that would result.

Rob


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to