in reply to Re^3: displaying html file in the browser using perl
in thread displaying html file in the browser using perl

Hiya, I have tried your code. But i guess the problem is i have also comments in the page like <!-- start of the page -->. it tries to think start of the page is the file and fails . so something which specifically looks for include file rather than looking for comments in the page. I still think my reg expression is not right.At the moment its
$html =~ s{<#include file="([^"]+)"}{&add_template($1)}gei;
I would really appreciate any help on this . Many Thanks,

Replies are listed 'Best First'.
Re^5: displaying html file in the browser using perl
by poj (Abbot) on Dec 19, 2016 at 20:03 UTC
    #$html =~ s{<#include file="([^"]+)"}{&add_template($1)}gei; # remove < ^ here $html =~ s{#include file="([^"]+)"}{&add_template($1)}gei;
    poj
      Thank you so much for your help. It seems to work they way it should and only looks for include file. But, still doesn't display the included file when i read aa.html on the browser. I have double checked the path and have tried to print only the included file and it does print the file individually. When i try to read with aa.html it just kind of ignores and doesn't print the included file. I have no idea what i am missing now. Many Thanks, T

        When "running from the browser", you need to use absolute path names. Instead of trying to open somefolder/cc.html, you will have to use /home/tsdesai/somefolder/cc.html for example.