Hey,
having spent mere loads of hours in apaches error logs this sounds really like a good idea! (though fortunately I haven't had to write CGIs for a good while now :)
Just two little remarks:
#!/usr/perl/bin -d:ptkdb
This probably should be
#!/usr/bin/perl -d:ptkdb
in your first call.
Does ptkdb come with perl? Which version? Or do we need to get from CPAN? I can't find it on my system: perl 5.6.0 running on SuSE Linux 7.1 out of the box