Jeff 'japhy' Pinyan wrote:

> For the task of parsing quoted strings, my book suggests the inchworm
> method:
>
>   push @terms, $1 while
>     /\G\s*"([^"]*)"/g or
>     /\G\s*(\S+)/g;

Hmmm...mine seems to go into an infinite loop:

#!/usr/bin/perl -w

use strict;
my @terms;

$_='"one two three" four "five six" seven "eight nine ten"';
push @terms, $1 while
    /\G\s*"([^"]*)"/g or
    /\G\s*(\S+)/g;
print "$_\n" foreach (@terms);



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to