Perl's equivalents of "include" are use, require and do. However, all of those methods expect the file that you're including to be Perl code, not HTML.
So I think that perhaps you want to just open the files and read the contents. Or maybe you should be looking at Server Side Includes or a decent Templating system.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
undef $/; open (FILE,"/path/to/header.html"); my $file =; close(FILE); print "$file";
Hi sbhar,
In perl, you can read the content of the file and can print in the html page. Like the sample code above given by perlsen. And also, there is a module HTML::Template you can refer the link. There is a function 'TMPL_INCLUDE' using that you can include the files. It's very simple and effective module for the usage of htmls.
Read this great tutorial: Including files.
perlmonks.org content © perlmonks.org and ambrus, davidrw, davorg, gube, izut, perlsen, sbhar
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03