On Oct 30, 1:30 pm, [EMAIL PROTECTED] (Rob Dixon) wrote:
> 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.

Good point.  Thanks for the correction.

Paul Lalli


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


Reply via email to