in reply to the multiple thread port scanner scripts issue
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.
In Section
Seekers of Perl Wisdom