# script requires an indexfile, with each # html filename to be concatenated in it # one html filename per line open(EACH_HTML_FILENAME,pagelist.txt) || die; open(UNIFIED_FILE,>>output.html) || die; # i could've used 'getopt' or @ARGV but this # is being written with brevity in mind ... # another thing i'd like to try to learn is # automatically geting a directorylist, parsing out # each filename with the extensions @ARGV and # concatenating them $first_pass = 1; while () { $thisfile = chomp($_); open(THIS_FILE,$thisfile) || die; if ($first_pass) { while () { if ($_ ne '') { print{UNIFIED_FILE} "$_" ; } else { $first_pass = 0; # exit this iteration of the while loop } } } else { $body_start = 0; while () { if (!($body_start) { if ($_ eq ') { $body_start = 1; } } else { if ($_ ne '') { print{UNIFIED_FILE} "$_" ; } else { # exit this iteration of the while loop } # END -> if ($_ ne '') } # END -> if (!($body_start) } # END -> while () } # END -> while () print{UNIFIED_FILE} "" ;