Re: Split function
- From: mritty@xxxxxxxxx (Paul Lalli)
- Date: Tue, 30 Oct 2007 12:49:37 -0700
On Oct 30, 1:30 pm, rob.di...@xxxxxxx (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
.
- References:
- Split function
- From: Irfan Sayed
- Re: Split function
- From: Paul Lalli
- Re: Split function
- From: Rob Dixon
- Split function
- Prev by Date: Re: Include variables from external perl script
- Next by Date: Re: Include variables from external perl script
- Previous by thread: Re: Split function
- Next by thread: RE: Split function
- Index(es):
Relevant Pages
|