my $dblinks = \'\';
$dblinks = $dbh->selectcol_arrayref(\"select db_link from db_links where ticket=\\\'LOW\\\'\");
my $success = 0;
for my $dblink (@$dblinks) {
$s
You don't show where $dbh
is assigned. Presumably you do so earlier. If you do not, then I beseech you to add these two litle lines to all your code files:
use strict;
use warnings;
...and they will save you from a world of hurt.
Earlier on when you create the db handle, you should check if something bad happened:
my $dbh = DBI->connect($data_source, $username, $password)
or die $DBI::errstr;
There is no real point in continuing with your program if you cannot get a db handle, is there? If you don't die, you should at least return from this function/method/area of code that is responsible for handling the DB.
There other issues with your code, such as using eval {}
blocks everywhere and calling functions with &
, but this has been covered quite amply in earlier questions on this site so I would encourage you to do a search.