Duh v D'oh

Nigel Rantor wiggly at wiggly.org
Thu Nov 6 17:00:16 GMT 2008


Paul Makepeace wrote:
> Following on the theme from a conversation with Mark at Dim Sum today*, spot
> the mistake I just wasted an hour on,
> 
>   my $publication_stats = [['Source', 'ID Publication', 'Article count']];
>   foreach my $given_source (%publication_map_by_name) {
>     push @$publication_stats, [$given_source,
>                                $publication_map_by_name{$given_source},
>                                $article_count_by_source{$given_source}];
>   }

You're setting $given_source alternately to be keys and values from the 
hash  %publication_map_by_name. This probably won't end well.

> If it's not staring out at you, you're possibly also a python programmer.
> Python here arguably DWIM better than perl.

Does python give you the keys by default?

   n


More information about the london.pm mailing list