View Single Post
Old 10-14-2003, 05:07 AM   #12 (permalink)
peacy
Crazy
 
Location: Reading, UK
Re: Tiny mistake, BIG problem

Mine wasn't really a spelling error. But I started crying when after 2 days of debugging and no sleeping I finally found the "//FJD" remark in the code. (Just For Debug).
After removing couple of lines after the remark everything worked like a charm...

Quote:
Originally posted by ratbastid
<code>
foreach my $key (sort {$rates->{$a} <=> $rates->{$b}} keys %$rates) {
&nbsp;&nbsp;$option_list .= '&lt;option value="' . $ups->servicenames($key) . $rates->{$key} "\">$key - $rates->{$key}</option>\n";
}
</code>
A remark about the perl code:
In the "foreach" line when you use the when you use "keys" it's not necessary to write %$. The % is enough. Like this:
<code>
foreach my $key (sort {$rates->{$a} <=> $rates->{$b}} keys %rates)
</code>
peacy is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73