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

In reply to Re^3: For each loop through mysql db to run Net::Telnet command by Marshall
in thread For each loop through mysql db to run Net::Telnet command by jay83

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.