in reply to record separator causing problems

In addition to the solution given by ++hippo, note that if there is more than one html element then to get the first one you need to make the quantifier non-greedy:

m{<html>(.*?)</html>}s

That said, you’d most likely be better-off (in the long run) using one of the dedicated XML modules: XML::Simple, XML::Twig, XML::Compile, XML::Tiny, XML::LibXML, ....

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: record separator causing problems
by jellisii2 (Hermit) on Dec 19, 2013 at 12:45 UTC
    Please for the love of $DEITY, use a XML parsing module. The XML parsing modules (I use XML::Twig) fix so... many... problems... -- Edit: Clarity

      Quite. If only there were ... oh, I don't know ... some sort of poll or something to bring it to everyone's attention.

      :)