Announcements

New Academic

fffff test some test content

#### use strict; use warnings; use File::Slurp qw/read_file/; use CGI; print CGI::header(); my $htmlfile ='/var/www/html/xx/xxx/1204.html'; my $html =read_file($htmlfile); my $includepath="/var/www/html/xx/xxxx/somefolder/"; if ($html =~ s{#include file="([^"]+)"}{&add_template($1)}gei) { print "the file has include file"; print $html; } else { print "doesn't have"; print $html; } sub add_template{ my $file = shift; #print "$file"; my $display_file="$includepath$file"; # print $display_file; if (-e $display_file){ #print "$display_file"; $sfile= read_file($display_file); #tried to see if it prints file and it does print print $sfile;# displaying the included file return read_file($display_file); } else { # warn "$display_file not found"; return ''; } }