This script was used: perl -0pi -e 's/(use Test[^\n]+)\n+clear_pages\(\);[^\n]*\n+/$1\n\n/' *.t
The question is whether bsd_glob("$PageDir/*/*.pg") will find page/other/.emacs.pg -- and apparently it does not, so that had to be added back in.