Hi everyone

Can anyone please tell me why the code below is not splitting the 'two
three'? 

If I use '\s*' instead of 's{1,}' it works but I would have thought the code
below would have been more precise.


my $string = 'one   two three    four';
my @temp = split(/ \s{1,}/,$string);
my $count_temp = scalar @temp;

print "$count_temp\n";

foreach my $element (@temp) {
    print "$element\n";
}

Thanks
John



-- 
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