Thanks very much - I has completely missed whitespace before the slash.

John


> -----Original Message-----
> From: Timothy Johnson [mailto:[EMAIL PROTECTED] 
> Sent: 16 March 2006 14:41
> To: John Bruin; beginners@perl.org
> Subject: RE: Splitting on white space
> 
> 
> It isn't splitting on the 'two three' because it doesn't match.
> 
> / \s{1,}/ matches a space followed by one or more whitespace 
> characters (you have a space in front of your \s)
> 
> 
> 
> -----Original Message-----
> From: John Bruin [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, March 15, 2006 5:37 PM
> To: beginners@perl.org
> Subject: Splitting on white space
> 
> Can anyone please tell me why the code below is not splitting the 'two
> three'? 
> 
> <snip>
> 
> my $string = 'one   two three    four';
> my @temp = split(/ \s{1,}/,$string);
> 
> 
> <snip>
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 
> 



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


Reply via email to