Re: Split function
- From: rob.dixon@xxxxxxx (Rob Dixon)
- Date: Tue, 30 Oct 2007 17:30:01 +0000
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
.
- Follow-Ups:
- Re: Split function
- From: Paul Lalli
- Re: Split function
- References:
- Split function
- From: Irfan Sayed
- Re: Split function
- From: Paul Lalli
- Split function
- Prev by Date: Re: Perl 5.8.6 bug in open()?
- Next by Date: Re: Syntax Checker Script
- Previous by thread: Re: Split function
- Next by thread: Re: Split function
- Index(es):
Relevant Pages
|