in reply to matching single-quoted-like strings (q{}, q//)

Seems to me that some configuration of Text::Balanced would work there, especially nothing the extract_quotelike operation.

And if that doesn't work, it's in the same bundle as Parse::RecDescent, which will definitely work.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on •Re: matching single-quoted-like strings (q{}, q//)

Replies are listed 'Best First'.
Re: •Re: matching single-quoted-like strings (q{}, q//)
by AltBlue (Chaplain) on Apr 03, 2003 at 22:48 UTC
    yes, Text::Balanced is supposed to be the right choice... but it seemed to me that i needed to do to much things before getting the results :( ... it would had be the best if it would have been as simple as something like:
    #!/usr/bin/perl -Twl use strict; use Text::Balanced qw(extract_quotelike); { local undef $/; my $string = <DATA>; my ($extracted, $remainder) = extract_quotelike($string); print $extracted; }
    .. but it doesn't work like this, looks like, as you said, more configuration is to be done. :(
    --
    AltBlue.