#!/usr/bin/perl -w # # opens up original HTML and inserts # into template html. and mirrors the other # files that it doesn't parse.... #Define variables ################## #Directory to parse (with trailing slash) $open_dir = 'C:/winnt/profiles/jt/desktop/html/'; #Directory to save parsed documents to (with trailing slash) $save_dir = 'C:/winnt/profiles/jt/desktop/blah/'; #Location of template HTML file $html_file = 'C:/winnt/profiles/jt/desktop/template.html'; #Extensions allowed to parse @exts = ('html','htm','shtml','shtm'); #Used to find html files to replace use File::Find; #Used to copy files to new location use File::Copy; #Assists in copying path directory structure use File::Path; #Starts the actual code &main(); exit; #Just in case of any accidents sub eachFile { my $filename = $_; my $fullpath = $File::Find::name; #remember that File::Find changes your CWD, #so you can call open with just $_ my $found = 0; foreach $ext (@exts) { if($filename=~/\.$ext$/) { print "\tOpening file $filename - "; my $content = &open_file("$filename"); print "Completed\n"; if($content=~m|