I just want a script whereby i can pass in a cgi file and it checks the first line - i.e. the shebang. If the shebang line is #!/perl/bin/perl change it to #!/usr/bin/perl .

Similarly if Ive got -wT on the end of the shebang line I want it to stay there. Maybe the code could automatically put on -wT and use CGI qw(:standard); and use CGI::Carp qw(warningsToBrowser fatalsToBrowser); and use strict; in case I forget. Yeah that would be ace.

I write and test all my scripts on my home PC running Apache on Winblows XP and the path to perl is #!/perl/bin/perl but the path to perl on my website is #!/usr/bin/perl. Its a little bit annoying when i forget this i get a 500 error and I scream "What the #$*@! ....[calms down] Opps forgot about the shebang" :)

it would be extra way cool if it could automatically FTP the file to a predetermined directory on my web server and chmod it to 755. That would blow my mind.

But all im really after is code for changing the shebang line so that i can attempt (my first attempt at non-web based perl) to make a win32 app using it.