But this output is not at all similar to the output desired in the original
post by Beau E. Cox. Your solution merely splits on all delimiters.

-ZO

"David Storrs" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]

> Personally, I would do this:
>
> #!/usr/bin/perl
> use Text::ParseWords;
>
> my $delims = qr!["'{}[\]#\s]!;
> my $line = 'This is#a#test\'of\'the"quotewords"function{with}separators[of
> many]kinds';
>
> my @words = &quotewords($delims, 0, $line);
> $i = 0;
> for (@words) {
>     print "$i: <$_>\n";
>     $i++;
> }
>
>
> Which outputs the following:
>
>
> 0: <This>
> 1: <is>
> 2: <a>
> 3: <test>
> 4: <of>
> 5: <the>
> 6: <quotewords>
> 7: <function>
> 8: <with>
> 9: <separators>
> 10: <of>
> 11: <many>
> 12: <kinds>
>
> Note that, since you are splitting on ', contractions and possessives
> will be mangled.



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