Silly Bugs!
October 6, 2005 on 10:21 am | In Foobars, Funnyish, Insider View by Josh Jones | 12 Comments
One little problem that cropped up since we pushed our swanky new web panel live was somehow domains were getting into our database with CAPITAL letters in them!
This causes some problems with adding email addresses, dns, domain registration and things like that in our system that assume a domain will always be all lowercase (since domain names are really case-insensitive).
At first glance, I couldn’t see how the domains were getting into the system like that with this check RIGHT THERE.
Can you?
12 Responses to “Silly Bugs!”
Powered by WordPress. Pool theme by Borja Fernandez, modified by DreamHost.
Like WordPress? Consider attending WordCamp LA.
Entries and comments feeds.
^Top^
October 6th, 2005 at 10:28 am
eq isn’t an assignment operator like ‘=’
Should this be the proper form?
$domain = lc ($domain);October 6th, 2005 at 10:28 am
Is this Perl I see before me? Is this an equality test, not an assignment?
October 6th, 2005 at 10:46 am
since i might as well be trying to read Koine Greek when I look at the code above, I’ll use this opportunity to say “I Like Jell-O.”
October 6th, 2005 at 11:15 am
Perhaps I am missing something but where do you set $domain equal to anything initially (unless you do this outside the sub). So as near as I can tell
$domain eq ”
so
” will always equal lc ”
October 6th, 2005 at 7:03 pm
I don’t get it.
October 6th, 2005 at 7:39 pm
Well, this isn’t what you’re looking for but if that script runs as is you’re not declaring “use strict;”.
Which makes you a bit, well, looney :)
October 6th, 2005 at 7:57 pm
I take the above back. $domain could be a global….which is it’s own bit of looniness, different from the first
October 6th, 2005 at 8:44 pm
Or PERHAPS it’s the third option… we could use global variable AND no “use strict;”
:)
But yeah, that line really should have been:
$domain = lc $domain;
October 7th, 2005 at 8:40 am
I see the problem. You should’ve used
$domain eq lc $domain or die;
;-)
October 12th, 2005 at 5:39 am
That could be the end of the function, where IIRC, the result of the comparison will be used for the return value. If we are considering globals we have to consider nuts who don’t use explicit return as well. ^^
October 18th, 2005 at 1:32 am
perl code is good while you write it by yourself for yourself, but if you want managable solution to be easy understood by others stick to something simple. like php. or java. or python. but php will be faster i believe
November 12th, 2005 at 2:12 pm
I dont
PageRank
SEO Directory
NETmoz Directory