[comp.sources.bugs] Perl problems/bugs

sanders@sanders.uucp (Tony Sanders) (11/28/89)

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?
                                         
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?

-- sanders
"Submitted for your approval,
 A lone programmer, enticed away from a high tech company in Dallas, journeys
 to Austin in search of cutting edge hardware and software.  Instead finds
 himself trapped in an cubicle with a one way ticket to . . .
			the AIX Zone.  -- Anon (w/BIG :-)

sanders@sanders.austin.ibm.com (Tony Sanders) (11/28/89)

I traced this problem down from op.sprintf into the %c function in
sprintf.  Anyone else having this problem????

script:
    #!/usr/bin/perl
    $x = sprintf("%c",65);
    if ($x eq 'A') {print "ok 1\n";}
    else {print "not ok 1 '$x'\n";}
    for ($i=0;$i<length($x);$i++) {
	$y = substr($x,$i,1);
	printf("\t" . '%2d("%s")  ',ord($y),$y);
    }
    print "\n";

output:
    not ok 1 'A'
	 0("")           0("")           0("")           0("")           0("")  
		       . . . [several more lines of nulls] . . .
	 0("")           0("")           0("")           0("")           0("")  
	65("A")  

 ---------- ALSO -----------

As a side note I'm also having problems with op.stat:
    if (-l 'perl') {print "ok 25\n";} else {print "not ok 25\n";}

-- sanders
Lost in a lost world -- Moody Blues

sanders@sanders.austin.ibm.com (Tony Sanders) (12/02/89)

In article <3065@cello.UUCP> sanders@sanders.austin.ibm.com (Tony Sanders) writes:
>I traced this problem down from op.sprintf into the %c function in
>sprintf.  Anyone else having this problem????
The problem was part of patch2 didn't get applied correctly to my source.

I seem to have everything working now, thanks ronald

-- sanders

-- sanders
Reply-To: cs.utexas.edu!ibmaus!auschs!sanders.austin.ibm.com!sanders
Thought should exist outside any governmental framework.

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (12/02/89)

In article <3063@cello.UUCP> sanders@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@jpl-devvax.jpl.nasa.gov