[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Problem with MacPerl 5.06




"Michael Kearney" <leprss!westol.com!violet> writes:
} 
} Now I'm not sure which one is working correctly in this instance, MacPerl or 
} Unix-Perl.

The way I read the Perl docs, I've always been convinced that MacPerl
is being more faithful to them.  As far as I can tell, since "my"
variables can never be seen in subroutines below the level that the
variable is declared, declaring them in a package outside of any
routine is pointless, and MacPerl is correct in simply forgetting them.
(The other thing the authors of lwp do is use my'ed variables in the
anonymous subroutines used to actually collect data from the socket.
That's in clear violation of the Perl docs, but it works in Unix Perl.)

But I suppose we should be practical about this.  I haven't looked at
very much of the code in the Perl 5 modules archive yet, but both
libwww-perl-5 and NetFTP use the "my" construct to initialize variables
in packages outside of routines.  And Unix Perl (at least on both Suns
and HP's) does what these authors expect, whether or not they're
writing code that conforms to the docs. Now the question becomes
whether whatever Unix Perl that's officially blessed for general use by
Larry Wall or the Perl docs are the authoritative source. And since
it's probably easier at this point to change the docs rather than Perl
and a bunch of modules, I assume that the behavior of Unix Perl is
"correct", even if it's not.  I wouldn't be suprised to learn that this
is due to some obscure bug in Unix or Mac yacc/bison (or whatever is
used), but should Matthias "fix" MacPerl or should we raise a stink and
try to get the various module authors to write doc conforming Perl?



} 
} Michael
} 
---
--------
Paul J. Schinder
NASA Goddard Space Flight Center,
Code 693, Greenbelt, MD 20771 USA
schinder@pjstoaster.pg.md.us