geekchick: (d'oh!)
geekchick ([personal profile] geekchick) wrote2005-10-18 02:48 pm
Entry tags:

Duurrrr...

I just spent 15 minutes trying to figure out why my code just wouldn't make a connection to the SMTP server.
my $confirmation = Net::SMTP->new(Host => $smtpserver,
                                  Hello => $domain,
                                  Timeout => 30,
                                  Debug => 1);
die "Couldn't connect to server" unless $smtp;


*facepalm* Yeah, a little bit braindead today I think.

[Edit: And hey, look! My domain registration expired. In my defense, I have never seen a single notification letter or email about it. All set for the next two years though.]

[identity profile] marnanel.livejournal.com 2005-10-18 06:54 pm (UTC)(link)
use strict is your friend :)

[identity profile] quasigeostrophy.livejournal.com 2005-10-18 06:57 pm (UTC)(link)
I hate it when that happens. :-)
gsh: (Default)

[personal profile] gsh 2005-10-18 07:12 pm (UTC)(link)
For those who aren't web programmers, can you tell me what's wrong with that? Is is that you set variable confirmation and test variable smtp?

[identity profile] nminusone.livejournal.com 2005-10-18 08:12 pm (UTC)(link)
That's what you get for bothering to check return codes. Just assume code always works!

[identity profile] nminusone.livejournal.com 2005-10-18 10:12 pm (UTC)(link)
Code intermittently working = ship it! Anything more reliable has a negative impact on job security. ;)

[identity profile] thunderbunny3.livejournal.com 2005-10-18 07:22 pm (UTC)(link)
Gods, I do things like that all the time. *hugs*

[identity profile] hopeforyou.livejournal.com 2005-10-18 08:15 pm (UTC)(link)
I can't tell you how many times I've had something staring me right in the face, only to not actually SEE it.

My sympathies.

[identity profile] stitchinthyme.livejournal.com 2005-10-18 09:56 pm (UTC)(link)
That's why I usually write something like:

my $confirmation = Net::SMTP->new(blahblahblah) || die "couldn't connect to server";

Less readable, but harder to mess up. :-)