2009/3/24 marcos rebelo <span dir="ltr"><<a href="mailto:oleber@gmail.com">oleber@gmail.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
refresh<br>
<div><div></div><div class="h5"></div></div></blockquote><div><br>Ah! Apologies, I did think to refresh, but apparently I can't drive Firefox...<br>Thanks ;-)<br><br>osf'<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="h5"><br>
2009/3/24 Hakim Cassimally <<a href="mailto:hakim.cassimally@gmail.com">hakim.cassimally@gmail.com</a>>:<br>
> 2009/3/24 marcos rebelo <<a href="mailto:oleber@gmail.com">oleber@gmail.com</a>><br>
>><br>
>> it is correct now<br>
><br>
> Correct how?<br>
><br>
> use strict; use warnings;<br>
> use Data::Dumper;<br>
> use Test::More tests => 1;<br>
><br>
> my %a;<br>
> @a{1,2,19,6,2,6}=(1..6);<br>
> my $keys = [ keys %a ];<br>
><br>
> is_deeply<br>
> $keys,<br>
> [ 1, 19, 2, 6 ],<br>
> '<a href="http://milan.pm.org/perl_test.html" target="_blank">http://milan.pm.org/perl_test.html</a>, question 14'<br>
> or diag Dumper $keys;<br>
><br>
> ####<br>
> 1..1<br>
> not ok 1 - <a href="http://milan.pm.org/perl_test.html" target="_blank">http://milan.pm.org/perl_test.html</a>, question 14<br>
> # Failed test '<a href="http://milan.pm.org/perl_test.html" target="_blank">http://milan.pm.org/perl_test.html</a>, question 14'<br>
> # at isd.pl line 11.<br>
> # Structures begin differing at:<br>
> # $got->[0] = '6'<br>
> # $expected->[0] = '1'<br>
> # $VAR1 = [<br>
> # '6',<br>
> # '1',<br>
> # '19',<br>
> # '2'<br>
> # ];<br>
> # Looks like you failed 1 test of 1<br>
><br>
> osf' ;-)<br>
><br>
>><br>
>> 2009/3/24 Hakim Cassimally <<a href="mailto:hakim.cassimally@gmail.com">hakim.cassimally@gmail.com</a>>:<br>
>> > 2009/3/24 marcos rebelo <<a href="mailto:oleber@gmail.com">oleber@gmail.com</a>><br>
>> >><br>
>> >> On Tue, Mar 24, 2009 at 5:54 PM, Michele Beltrame <<a href="mailto:mb@cattlegrid.info">mb@cattlegrid.info</a>><br>
>> >> wrote:<br>
>> >> > I would say number 14 could be changed a bit, as keys() might return<br>
>> >> > keys in any order, so arrays shown as options could not be correct as<br>
>> >> > far as ordering is concerned.<br>
>> >><br>
>> >> before there was a sort in there. You don't imagine the casino in the<br>
>> >> Lisbon PM, the alphabetic order, ...<br>
>> >><br>
>> >> So at the end, this is the only possible answer.<br>
>> ><br>
>> > Except that without the sort the answer is wrong, and with the sort the<br>
>> > answer is right ;-)<br>
>> ><br>
>> > DB<6> @a{1,2,19,6,2,6}=(1..6); print Dumper([ sort keys %a<br>
>> > ]);<br>
>> > $VAR1 = ['1','19','2','6'];<br>
>> ><br>
>> > You could try sort { $a <=> $b } keys %a to be clearer?<br>
>> > osf'<br>
><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Milan-pm mailing list<br>
> <a href="mailto:Milan-pm@pm.org">Milan-pm@pm.org</a><br>
> <a href="http://mail.pm.org/mailman/listinfo/milan-pm" target="_blank">http://mail.pm.org/mailman/listinfo/milan-pm</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Marcos Rebelo<br>
<a href="http://oleber.freehostia.com" target="_blank">http://oleber.freehostia.com</a><br>
Milan Perl Mongers leader <a href="http://milan.pm.org" target="_blank">http://milan.pm.org</a><br>
_______________________________________________<br>
Milan-pm mailing list<br>
<a href="mailto:Milan-pm@pm.org">Milan-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/milan-pm" target="_blank">http://mail.pm.org/mailman/listinfo/milan-pm</a><br>
</div></div></blockquote></div><br>