Perl Christmas Quiz 2009

Matt Sergeant msergeant at messagelabs.com
Tue Dec 1 16:40:54 GMT 2009


On Tue, 1 Dec 2009 11:23:09 -0500, Matt Sergeant wrote:
> On Mon, 30 Nov 2009 18:24:12 +0000, Chris Jack wrote:
>> 1) Without running it to check, what does the following program output?
>> 
>> 
>> my %a = (3,2,1,0);
>> 
>> 
>> for my $b (sort values %a) {
>>     $b += 4;
>> }
>> 
>> 
>> print $a{1} . "\n";
> 
> Bizarrely enough, on both my Snow Leopard machines (default perl 
> install) this outputs: 4D
> 
> Nice bug there.

Ah. It's the D from ^D. Shitty terminal.

Matt.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________


More information about the london.pm mailing list