Also know that when coding Perl in the Windows world, the she-bang line (that first line in the script) is not read unless Perl is triggered with the -T option (at least I do remember reading that somewhere).
I know you have cgi in the subject, but wanted to point that out.
Comment