Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!decwrl!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: PERL 3.0 PL28 defined(&foo) test does not work on SCO UNIX Message-ID: <9458@jpl-devvax.JPL.NASA.GOV> Date: 11 Sep 90 06:42:55 GMT References: <1990Sep10.052102.5148@ping.uucp> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 32 In article <1990Sep10.052102.5148@ping.uucp> gorpong@ping.uucp (Gordon C. Galligher) writes: : Due to many problems I was having with Perl 3.0/PL28 on an SCO UNIX 3.2 : system, I decided to re-make all of it and apply all patches from 19-28. : Upon getting it to that stage, I noticed a bug. When executing t/op.undef : it fails on test 20. This tests the defined(...) operator to test the : existence of a function. It always returns FALSE (or whatever FALSE is : in PERL). I have not had the opportunity to delve into the source to : submit a quick patch for any SCO UNIX sites out there. All other tests : worked (except for op.dbm). : : I have been having another problem on EVERY perl system dealing with : packages, but that is a different subject, and I need to do more testing : before I post anything on it. Don't work too hard on it till the next patch comes out, which may affect what you're doing. : Any idea on why defined(&fcn) is broken? Comments, Larry? I imagine your compile is hiccuping on the lines in consarg.c that say if ((arg->arg_type == O_DEFINED || arg->arg_type == O_UNDEF) && (arg1->arg_type == (perldb ? O_DBSUBR : O_SUBR)) ) { arg[1].arg_type |= A_DONT; } Try simplifying that and see if it works better. If the conditional is false when it should be true, it'll end up calling the function and checking to see if the return value is defined instead of checking to see if the routine is defined. (The A_DONT flag suppresses evaluation.) Larry