No idea how to do this within perl/js... BUT... ...i *do* know that, if you're able to access php.ini - the php configuration file... auto_prepend_file = AND auto_append_file = Can be set to whatever files you want automatically put before and after the page source. -m