Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!eagle!eagle.lerc.nasa.gov!mikef From: mikef@borg.lerc.nasa.gov (Mike J. Fuller) Newsgroups: comp.lang.perl Subject: Bugs with Perl on Irix 3.3.2 Message-ID: <1991Jun25.161513.19286@eagle.lerc.nasa.gov> Date: 25 Jun 91 16:15:13 GMT Sender: news@eagle.lerc.nasa.gov Reply-To: mikef@sarah.lerc.nasa.gov Distribution: comp Organization: Computational Materials Laboratory, NASA Lewis Research Center Lines: 49 X-Newsreader: GNU Emacs 18.57.2, GNUS 3.13, NNTP 3.10 Just in case anyone is interested, the following Perl script which I use to start AMD fails to work correctly under Irix 3.3.2: #! /usr/local/bin/perl $amd = "/usr/local/etc/amd"; $master = "amd.master"; open (YPCAT, "ypcat -k $master |") || die "Cannot open pipe from ypcat.\n"; $args = "-p -r -a /tmp_mnt -l syslog"; while () { chop; split; if ( -d "$_[0]" || ("$_[2]" !~ /direct/)) { $args = "$args $_"; } } close(YPCAT); exec "$amd $args > /etc/amd.pid"; die "Failed to exec amd.\n"; The -d "$_[0]" always evaluates true, causing every directory in the map to be automounted. I tried a simple Perl script like: if ( -d "/tmp/foo" ) { print "Foo.\n"; } and it worked correctly for the cases when "/tmp/foo" didn't exist, was a directory, and was a plain file. Since I am used to the Mips compilers being Buggs Bunny, I recompiled Perl with GCC and it now works correctly. Incidently, if you want to compile Perl with GCC under Irix 3.3.2, the first line of perly.c which reads: extern char *malloc(), *realloc(); will have to be changed to: extern void *malloc(), *realloc(); or commented out after the YACC run. /-----------------------------------------------------------------------------\ | Mike J. Fuller | Internet: mikef@sarah.lerc.nasa.gov | "I hate | |----------------| mikef@zippysun.math.uakron.edu | quotations." | |/\/\/\/\/\/\/\/\| Bitnet: r3mjf1@akronvm | -- R.W. Emerson | \-----------------------------------------------------------------------------/