On May 19, 2004, at 9:52 AM, Graf Laszlo wrote:

Hi
I have the following HTML structure:

<sm:a>
        <sm:b>
                BBB
        </sm:b>
        <sm:c>
                CCC
        </sm:c>
</sm:a>

Every line in this structure is an element of an array,
named @lines, and I access the elements using a foreach loop.

When I know the tag's name, by example 'sm:a',
and I need to extract the information contained by '<sm:a>'
and '</sm:a>' pair and the tags too, how should I proceed ?

Not totally sure I understand, but let's see if this gets you going:

my $tags = join '', @lines;
print "$1\n" if $tags =~ m/<sm:a>(.*?)<\/sm:a>/s;

Hope that helps.

James


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