it all works fine now

Just had to tweak search.pl a bit more and now it works flawlessly.
The only thing I've noted though is it does the job for sites that are just .html files, but as soon as you point the script at directories that have .php files...well, things start behaving a little strangely. No problem, this is awesome for now and works 100% perfectly well for my needs.
this ticket can be closed. (nvmnd that's right I'm not at work right now lol)