[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Omaha.pm] Fwd: "3 apples" + "2 oranges"
I guessed 17... I would have thought Perl would get all smart and Perl'y and
assume I was creating an array and asking for the array count.
-----Original Message-----
From: Sean Baker [mailto:pbaker@omnihotels.com]
Perl seems to be tossing the apples and oranges out because of the +
operator. I guessed 2 also.
-----------------
>> What do you think this displays, without running it?
>> my $n = "3 apples";
>> my $m = "2 oranges";
>> print $n + $m;
>>
> 2?
5