[Milan-pm] PErl Test

marcos rebelo oleber at gmail.com
Tue Mar 24 10:10:40 PDT 2009


it is correct now

2009/3/24 Hakim Cassimally <hakim.cassimally at gmail.com>:
> 2009/3/24 marcos rebelo <oleber at gmail.com>
>>
>> On Tue, Mar 24, 2009 at 5:54 PM, Michele Beltrame <mb at cattlegrid.info>
>> wrote:
>> > I would say number 14 could be changed a bit, as keys() might return
>> > keys in any order, so arrays shown as options could not be correct as
>> > far as ordering is concerned.
>>
>> before there was a sort in there. You don't imagine the casino in the
>> Lisbon PM, the alphabetic order, ...
>>
>> So at the end, this is the only possible answer.
>
> Except that without the sort the answer is wrong, and with the sort the
> answer is right ;-)
>
> DB<6> @a{1,2,19,6,2,6}=(1..6); print Dumper([ sort keys %a
> ]);
> $VAR1 = ['1','19','2','6'];
>
> You could try sort { $a <=> $b } keys %a to be clearer?
> osf'
> _______________________________________________
> Milan-pm mailing list
> Milan-pm at pm.org
> http://mail.pm.org/mailman/listinfo/milan-pm
>
>



-- 
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org


More information about the Milan-pm mailing list