in reply to HTML INCLUDES

You've identified the solution I'd choose (HTML::Parse or another module), but in the absence of that, you can get a pretty good solution with split:
my @chunks = split(/<!--#include virtual="([^"]+)" -->/, $data); while (@chunks) { # ought to splice here my ($html, $inc) = (shift @chunks, shift @chunks); # print $html to file # include $inc if possible }
Beware that @chunks may contain an odd number of elements, so $inc may be empty on the last iteration.

It's not the *best* way to do it, but it's one way to do it.

Replies are listed 'Best First'.
Re: Re: HTML INCLUDES
by vbrtrmn (Pilgrim) on Apr 30, 2001 at 23:07 UTC

    I think that's going to do it for me

    thanks a lot!!

    --
    paul