SPUG: Something to loose sleep over
Lauren Smith
LaurenS at bsquare.com
Fri Apr 28 11:49:15 CDT 2000
> -----Original Message-----
> From: David Waring [mailto:dwaring at nwsr.com]
>
> Warning this is a demonstration of a bug that only appears in certain
> installations of Perl. It is a weird bug and I am really pointing it
> out as a topic of conversation. Ignore this if you are not interested
> in really yucky stuff.
> # call a subroutine several times with different parameters
I took the liberty of initializing @A, @D, and @X thusly:
@a = ('a');
@d = ('d');
@x = ('x');
>
> asubroutine(\@A,"B","C");
> asubroutine(\@D,"E","F");
> asubroutine(\@X,"Y","Z");
>
> sub asubroutine{
> print @_,\n";
> $x= shift @_;
> $y= shift @_;
> $z= shift @_;
> }
>
> RESULTS
> ABC
> ABC
> ABC
>
Why would the first element of @_ be a character? Does AIX pull the value
directly out of 'ARRAY(0xca7408)'?
>
> Now we can fix this in several ways. All of the following changes
> behaved properly an had the expected results of
> ABC
> DEF
> XYZ
I'm not even sure that that would be the expected results, though.
ARRAY(0xca7408)bc
ARRAY(0xca7480)ef
ARRAY(0xca74f8)hi
These are the results that I got (NT 4, SP6).
> We will be reinstalling Perl on this box but does anyone have any
> idea what in the deepest bowels of Perl could be going on here????
I wish I knew, it looks really hairy.
Good luck!
Lauren
(New to the group. Hi group!)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe
Email to majordomo at pm.org: "action" spug-list your_address
More information about the spug-list
mailing list