[comp.lang.perl] PS41 ESIX 3.2

dhesi%cirrusl@oliveb.ATC.olivetti.com (Rahul Dhesi) (11/18/90)

All went well with patchlevel 41 under ESIX 3.2 on a 386 except that
TEST didn't work because of the lack of #!.  The "nih" perl script
failed to fix this, because of some strangeness with the in-place
editing.  If perl (while executing "nih") is doing in-place editing on
a file $FILE and if $FILE.bak exists, then $FILE is changed to a
zero-length file.  Another problem was that, due to the 14-character
filename limit under ESIX (and this despite the vendor's claim that the
Berkeley FFS is implemented), when perl creates $FILE.bak, it might
only create "$FILE.ba" or "$FILE.b" or "$FILE." (if $FILE already has
11 or more characters), and then fail to find it due to filename
truncation.

I revised "nih" to a /bin/sh script so it makes a copy of each file in
a temp file with a short name, makes sure no corresponding *.bak
exists, gives it to a separate perl script, then moves the temp file
back to the original file.  So the work-around is satisfactory.  But it
looks like the bug is definitely there:  if you do "perl -Spi.bak x"
and both x and x.bak exist, x can end up being a zero-length file.

Perl needs a better mechanism for in-place editing that is resistant to
filename truncation.

(Of course, despite this minor flaws, perl's a great program.)
--
Rahul Dhesi <dhesi%cirrusl@oliveb.ATC.olivetti.com>
UUCP:  oliveb!cirrusl!dhesi