Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: For each loop through mysql db to run Net::Telnet command

by Marshall (Canon)
on Nov 10, 2022 at 15:36 UTC ( [id://11148103]=note: print w/replies, xml ) Need Help??


in reply to Re^2: For each loop through mysql db to run Net::Telnet command
in thread For each loop through mysql db to run Net::Telnet command

Yeah, there are some cut-n-paste errors above. Unfortunately you didn't provide a complete example for me to test my code with.

First suggestion is to get rid of the "or die" statements, by specifying the raise error option during the dB connect. A little short of time this morning, but the below is some actual working code from a few days ago on an SQLite DB. I use $dbh for the data base handle. You can follow this pattern.

my %attr = ( RaiseError => 1); #auto die with error printout my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfilename","","",\%attr) or die "Couldn't connect to database $dbfilename: " . DBI->errstr; my $get_qsos = $dbh->prepare ("SELECT * FROM raw_qsos WHERE rcv_call = ?"); $get_qsos->execute($call); my $resultRef = $get_qsos->fetchall_arrayref; my $n_dbQso = scalar(@$resultRef); #number of rows with that call

Replies are listed 'Best First'.
Re^4: For each loop through mysql db to run Net::Telnet command
by jay83 (Novice) on Nov 14, 2022 at 13:15 UTC
    No problem Marshall - thank you for the follow up and help!!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-18 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found