[Xitami] Shebang #! question on win98

Paul Reid xitami@lists.xitami.org
Tue, 26 Jun 2001 12:41:26 -0400


>  #! usr/bin/perl path, ... will not work on Xitami.

On Xitami in DOS/Windows? Sure it does. 

The average unix interpreter and webserver wants the she-bang line to be
exact; they won't go searching for Perl.

As Ewen says, Xitami (at least when compiled for DOS/Win) is "Generous".
It knows that DOS is different, and it would be awkward to re-edit
scripts every time you move from unix to DOS. 

If the folder that the she-bang line points to doesn't exist, it pulls a
copy of PATH and starts hunting for Perl or Perl.exe. 

To prove that Xitami is pretty smart, I have some scripts with #!
/bing/bang/boom/perl , and it works. That fails, but PATH contains
d:\perl , and Xitami quickly finds it there. 

Probable problems: 

Perl Install asks if you want Perl on PATH. I hope you said Yes. Also,
you often have to shut-down and re-start Windows to get the changed
PATH. (You can force it manually, but Win98 needs a break anyway.)

Open a Command window and type PATH. If Perl's folder is on there,
re-start Xitami and it should work. If it isn't there, re-start Windows.
If you didn't let Perl Install modify PATH, open AUTOEXEC.BAT in notepad
and add it, restart.

Putting Perl in a path with a space in it (typically under "Program
Files" can give trouble. Very long (over 62 characters) paths can also
be iffy. I'm not sure if this is Xitami or Perl, but IAC nobody can
exactly duplicate MS's wacky handling of long spacy filenames. K.I.S.S.:
Keep It Short and Sweet. 

There is a limit in DOS/Win9x on the size of PATH (actually the
envoronment). If you've installed many programs that all think they
deserve to be on PATH (most don't), you may have to trim. 

In the unlikely event that you have a DOS/Win system that really does
have a /usr/bin directory, I thought that Xitami would fail if the
folder was valid and the program name wasn't right there. Mayeb I'm
wrong. If I'm right, the logical thing to do is put Perl in /usr/bin. 

 -PRR