Leopold Toetsch <[EMAIL PROTECTED]> writes:
> Sam Ruby <[EMAIL PROTECTED]> wrote:
>
>> I took a look into this. Apparently, in Perl5, the result of xor'ing
>> undef with anything is undef. I'm not suggesting that this is either
>> right or wrong (it actually was surprising to me),
>
> Yep. It doesn't really follow the definition of xor, nor does it match
> the implementation of other types.
Which Perl5 (xor, undef) would this be? It does not look like the
result is undef around here:
[EMAIL PROTECTED]:~$ perl -le 'print defined($_)?"defined":"undef", ": �$_�"
for map {(undef xor $_), ($_ xor undef), (undef ^ $_), ($_ ^ undef)}
"string", "", -1, 0, 1 , 2'
defined: �1�
defined: �1�
defined: �string�
defined: �string�
defined: ��
defined: ��
defined: ��
defined: ��
defined: �1�
defined: �1�
defined: �4294967295�
defined: �4294967295�
defined: ��
defined: ��
defined: �0�
defined: �0�
defined: �1�
defined: �1�
defined: �1�
defined: �1�
defined: �1�
defined: �1�
defined: �2�
defined: �2�
[EMAIL PROTECTED]:~$ perl -v
This is perl, v5.8.5 built for i686-linux
Copyright 1987-2004, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to the
Internet, point your browser at http://www.perl.com/, the Perl Home Page.
[EMAIL PROTECTED]:~$
--
C++ is the only current language making COBOL look good.
-- Bertrand Meyer