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

My tip is to never use $1 (and its other numbered siblings) in a subroutine that doesn't also set them up. Always pass them around as parameters and use the parameters in the subroutine only. My example shows that approach.

This is IMO the better approach because it avoids the problem that a subroutine itself might execute another match (maybe for debugging) and then will overwrite the value you wanted to use.

Replies are listed 'Best First'.
Re^6: displaying html file in the browser using perl
by tsdesai (Acolyte) on Dec 19, 2016 at 13:53 UTC
    ok, i have updated the code so it uses $filename. But iam still having problems getting the name of the file from the regular expression.It still gets the entire include filename="hh.html--> Will keep you updated how i get on. Thanks, for all your help so far.