Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: the multiple thread port scanner scripts issue

by roboticus (Canon)
on Jan 26, 2013 at 14:34 UTC ( #1015493=note: print w/ replies, xml ) Need Help??


in reply to the multiple thread port scanner scripts issue

jeremy.fang:

The reason that the date isn't being updated in your database is because you're not telling it to do so. I'd change your update statement from:

my $upd_sth = $dbh->prepare("update psinfo set port=\'$myport\' where +domainname=\'$line\'"); $upd_sth->execute() or die "unable to execute update line where name i +s $line! error $DBI::errstr";

to something like this:

my $upd_sth = $dbh->prepare(q{ update psinfo set port=?, last_checked=getdate() where domainname=? }); $upd_sth->execute($myport, $line) or die "unable to update: name=$line! error\n$DBI::errstr\n";

Note: I don't recall the method to get the current date/time in MSSQL, so I just guessed. I also converted your code to use placeholders, because:

  • they're safer,
  • they're easy to use
  • they make the SQL more readable (in my opinion)

I'm sorry, but I can't quite make out all of your question, nor can I make much sense from your code, so that's about all I can offer for now.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


Comment on Re: the multiple thread port scanner scripts issue
Select or Download Code
Re^2: the multiple thread port scanner scripts issue
by jeremy.fang (Initiate) on Jan 28, 2013 at 07:13 UTC
    thanks your reply
    can you added the thread into the scripts

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015493]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (9)
As of 2014-12-18 05:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (42 votes), past polls