develooper Front page | | Postings from July 2002

Re: Golf this.

Thread Previous | Thread Next
July 16, 2002 00:14
Re: Golf this.
Message ID:
En op 16 juli 2002 sprak |3en:
> Hu... I may make a mistake, but...
> Isn't this one...
> -p $h{$_}++}for(sort%h){
> ...shorter ?

Yes |3en, this is your third mistake.
Your first was challenging `/ in tpr04, and your
second was challenging him yet again in tpr04b.

Because we are using %h and not keys%h you must
set it to "" and not a number. Rick's
  -p $h{$_}=1}for(sort%h){
suffers from the same bug.

You can fix like this:
  #!perl -p
  $h{$_}++}for(sort keys%h){


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About