[Omaha.pm] Fwd: "3 apples" + "2 oranges"

Thompson, Kenn KThompson at heiskell.com
Tue Jul 18 11:34:30 PDT 2006


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 at 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
 



More information about the Omaha-pm mailing list