![]() |
Tiny mistake, BIG problem
Just in case any of you were wondering, when you're working in Perl, building a select box of shipping rates, there's a HUGE difference between this:
<code> foreach my $key (sort {$rates->{$a} <=> $rates->{$b}} keys %$rates) { $option_list .= '<option value="' . $ups->servicenames($key) . $rates->{$key} . "\">$key - $rates->{$key}</option>\n"; } </code> And:<code> foreach my $key (sort {$rates->{$a} <=> $rates->{$b}} keys %$rates) { $option_list .= '<option value="' . $ups->servicenames($key) . $rates->{$key} "\">$key - $rates->{$key}</option>\n"; } </code> One dot makes all the difference between "runs" and "not runs". That dot is the difference between "happy customer" and "SAD customer". What obnoxious little spelling errors have YOU programmed recently? |
Lets see...I think I missed a " somewhere and I spent three hours searching a 5k line file for where the error was. That I think was my most recent
|
Quote:
case sensitive bastards. |
Quote:
|
Programmers scare me.
I don't have a very "structured" mind that can look at things in a "logical" manner. My mind is all over the place, jumping from topic to topic, trying to understand the Big Picture etc. Makes me a good PM, but I would be crap at programming... Mr Mephisto |
Quote:
Okay, so "print" isn't spelled with a "g" on the end. You knew what I MEANT!!! |
Oh man. You have no idea how wonderful that syntax highlighting in vim is until you try to work without it. I used to find it irritating to begin with, but now I can't work without it.
|
I still have a habit of leaving out semicolons, which always seems to throw up random entertaining errors.
|
Debugging?
Try any program in Miranda... It keeps throwing up errors like Code:
type [[[[[[[[]]]]]]]] is unequal to [[[[[[[]]]]]]] |
O vs 0.
I spent a day tearing out my hair (much thicker then) over this one. |
Quote:
|
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:
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> |
Quote:
Try running the following code: Code:
#!/usr/bin/perl |
Quote:
|
All times are GMT -8. The time now is 02:37 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project