Hi All,

I would like to understand the behavior of the following program:

========program start==========
#!/usr/local/bin/perl

use strict;
use integer;

my @a=qw(1 0 0 0 0 0 0 1);
my @b=qw(0 0 0 0 0 0 0 0);

my $d=$a[0];
my $e=$b[0];

my $f=($d)^($e);
print " 1 = $d , $e , $f\n";

$d=1;
$e=0;

$f=$d^$e;
print " 2 = $d , $e , $f\n";
==========program end==========

gives output:

====output start======
1 = 1 , 0 ,
2 = 1 , 0 , 1
====output end========

I would like to understand why $f does not have any value in the first print statement. perl version being used is v5.8.0

Thanks and Regards,
Rajanikanth

--
Rajanikanth
ASIC, Texas Instruments India
Phone : +91-80-25099116
Fax   : +91-80-25048213
Email : [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to