Perl problems/bugs

Larry Wall lwall at jpl-devvax.JPL.NASA.GOV
Sat Dec 2 07:27:52 AEST 1989


In article <3063 at cello.UUCP> sanders at sanders.uucp (Tony Sanders) writes:
: I'm having a coupla problems with perl RT/AIX 2.2.1.  Perl 3.0 is the
: first version I've used so I know not if this is new:
:     sanders:pts0 % perl -v
:     $Header: perly.c,v 3.0.1.2 89/11/17 15:34:42 lwall Locked $
:     Patch level: 6
: 
: 1)  The complete.pl that comes with perl reads:
:     ...
: 	sub Complete {
: 	    local ($prompt) = shift (@_);
: 	    local ($c, $cmp, $l, $r, $ret, $return, $test, $x);
: 	    @_ = sort @_;
:     ...
: 
:     However the "@_ = sort @_;" seems to nuke the @_ array, leaving
:     it null.  I worked around this by simply changing all @_ references
:     in the sub to @x and that works great.  Bug or feature?

Bug.  In perl 3.0 the @_ array was made to pass items in by reference,
so it's not a "real" array in some senses.  The code for assignment
should make it into a real array, but it doesn't (yet).
                                         
: 2)  When I do a "make test" various tests fail:
: 	cmd.subval, op.dbm, op.index, op.mkdir, op.pack,
: 	op.read, op.sort, op.substr, op.vec
:     
:     like:
: 
:     sanders:pts0 % perl cmd.subval
:     syntax error in file cmd.subval at line 91, next 2 tokens ");"
:     Execution aborted due to compilation errors.
: 
:     I found that line 91:
: 	return (1,2,3);
:     when changed to:
: 	return(1,2,3);        # no space after keyword
:     works DFK.
: 
:     This is also true for the other tests mostly print statements.
:     Again, bug or feature that you cannot have a space after a keyword?

A compiler problem.  Try defining CRIPPLED_CC, which turns some complicated
macros into subroutines.  If that doesn't work, turn off your optimizer for
at least toke.c, maybe for everything.

Larry Wall
lwall at jpl-devvax.jpl.nasa.gov



More information about the Comp.sources.bugs mailing list