Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re: Not getting the expected result when using eval/alarm

by JamesNC (Chaplain)
on Jan 08, 2006 at 14:33 UTC ( #521817=note: print w/replies, xml ) Need Help??

in reply to Not getting the expected result when using eval/alarm

try doing your dbi connect stuff like this:
eval { $db = DBI->connect("dbi:mysql:database="$remotedb"; host=;p +ort=$port", "$user", "$pass", { RaiseError=>1, PrintError=>0 } ); }; if ($@){ #handle db error (ie, host not available.. blah blah }else{ return $db; }

Notice I added {RaiseError=>1, PrintError=>0} to your dbi call and then eval the call to DBI.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://521817]
[james28909]: ok i have a new question ;)
[james28909]: i am not sure how to ask google this either
[james28909]: i am getting the current time on my machine with scalar localtime;
[james28909]: i am scraping a website and retrieving a date stamp of an article.
[james28909]: well time/data stamp of the article
[stevieb]: james28909: what's the problem/question?
[james28909]: it is not an absolute date like "27" or "31". sometimes it is like wednesday or friday

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-04-29 02:32 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.