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

Re: [MacPerl] Problems with Butler.XFCN & Perl 5.1.9.r4



On Sun, 12 Apr 1998 11:13:48 -0600, David Steffen wrote:
>
>Chris's help allowed me to solve the problem.  The difference between
>versions 5.07r1m and 5.1.9r4 can be seen in their behavior on the
following
>code:
>
>$a = undef;
>$c = ($b) = $a;
>
>In MacPERL 5.07r1m, $c is undefined.
>In MacPERL 5.1.9r4, $c is 1.
>
>Could anybody comment on which of these behaviors is correct?
>
>Which behavior should I expect in the future?

I'm away from my references. so I can't be completely sure, but I'm
positive the second is correct. This is not peculiar to MacPerl, of
course, but is a Perl feature. ln a scalar context. any list returns the
number of items in the list. You have set $c= ($b). The $c on the left
of the = sets the context, so the list on the right. ($b), gives back
the number of elements, 1. Had you left off the parentheses, you would
have gotten $c= undet. I'd guess, if you look at the changes between 1m
and 04. you'll find that this was broken and has been fixed.

>
>THANKS!
>
>-David-



-------
Paul J. Schinder
schinder@pobox.com


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch