in reply to Re: displaying html file in the browser using perl
in thread displaying html file in the browser using perl
I am not quite sure what i am doing wrong but there's something that i am missing definitely. Many Thanks, Tmy $includepath="somefolder/somefolder/"; $html =~ s/<!--#include file="([^"]+)"-->/&add_template($includepath.$ +1)/gexi; print $html; sub add_template{ #use File::Slurp qw/read_file/; if(!-f $1){ return "Could not include template '$_[0]' because: NO F +ILE" }elsif(!-r $1){ return "Could not include template '$_[0]' because: NO AC +CESS TO FILE +"; } else { return read_file($_[0]); } }
|
|---|