glenwild has asked for the wisdom of the Perl Monks concerning the following question:

Given a CGI Perl script(.pl) running on a remote Apache/1.3.26 (Unix) server that needs to have the Perl script starting with
  #!/usr/bin/perl -w...
and my local server is running Apache/1.3.26 (Win32) mod_perl/1.26_01-dev and needs to see a script(.pl) starting with
  #!c:/perl/bin/perl.exe -w...

Question: Is there some way to map the Perl interpreter in Apache 1.x so I do not have to keep editing the shebang (#!) line before uploading the file? (Yes, a bit off topic, but not far from the beaten path :-)  As you might guess, I have shot myself in the foot once too often forgetting to change the shebang before uploading and changing it back before continuing to work on the local server.

Qualifier: I prefer an Apache based solution rather than say a Perl-based Net::FTP script performing the mapping during the upload as I prefer to use a drag-and-drop interface to upload the files.  This will also hopefully give rise to a more general solution for supporting multiple remote servers wherein the Perl executable does not always live in the same place, e.g. /usr/bin/perl, /usr/local/bin/perl, etc.  TIA!

Replies are listed 'Best First'.
Re: shebang mapping
by glenwild (Novice) on Sep 29, 2002 at 21:22 UTC
      Super Search++ :) Answering your own question is always good too, I find that that's the way I learn the most.
Re: shebang mapping
by Dr. Mu (Hermit) on Sep 30, 2002 at 04:35 UTC
    One solution not mentioned on the other node is just to get an old 486 or Pentium box with an ethernet card and load Linux/Perl/Apache on it. Use that to proof your CGI scripts from your Windows browser before uploading them. That's what I used to do before Linux became my main web development platform. It costs next to nothing, and your server environment will more closely match that of your hosting service.
      Additional comment: it pays to have a staging server which is exactly configured like the live server. This way you can test for all kind of unexpected behaviour due to omissions you otherwise lightly overlook.

      I still remember the time when libcrypt on my linux box was different from the live version (running Free BSD) and suddenly no of our customers could log in any more through a new series of CGI scripts. Big shame on us!

      --
      Cheers, Joe