Duurrrr...

Oct. 18th, 2005 02:48 pm
geekchick: (d'oh!)
[personal profile] geekchick
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.]

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

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

Date: 2005-10-18 07:12 pm (UTC)
gsh: (Default)
From: [personal profile] gsh
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?

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

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

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

Date: 2005-10-18 08:15 pm (UTC)
From: [identity profile] hopeforyou.livejournal.com
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.

Date: 2005-10-18 09:56 pm (UTC)
From: [identity profile] stitchinthyme.livejournal.com
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. :-)

Profile

geekchick: (Default)
geekchick

April 2017

S M T W T F S
      1
2345 6 78
9101112131415
16 171819202122
23242526272829
30      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 11th, 2025 08:32 am
Powered by Dreamwidth Studios