Re: calculate within a loop

2016-09-10 Thread Jim Gibson
> On Sep 9, 2016, at 8:54 AM, Nathalie Conte wrote: > > Hello, > I have a question about making a calculation within a loop > > I have a hash of hashes > ## > #!/usr/bin/perl > use strict; > use warnings; > > use Data::Dumper qw(Dumper); > > my %grades; > $grades{"Foo "}{1} =

Re: calculate within a loop

2016-09-10 Thread Aaron Wells
Hi there, Me again. The sort function does NOT default to <=>. It defaults to string comparison order. See the Perl doc for sort: "If SUBNAME or BLOCK is omitted, sorts in standard string comparison order. " So assuming you want numbers sorting, 'sort { $a <=> $b } keys %{$nameref}' would be the