I’m writing a perl script that will access a MySQL database to determine whether or not a tool has passed or failed and I’m getting an error when I try to fetchrow_array on the code.
Basically what is happening is I’m looping through a list of tests to see if they have passed or failed so the loop looks like:
foreach my $test (@tests){
$sth = $dbh_k->prepare("select fn_get_test_status(' $test ');");
$sth->execute();
my @data = $sth->fetchrow_array();
print("$test\n");
print("@data\n");
}
and that function returns either the string “passed” or “failed” however I can’t figure out how to pull just that one string out and incorporate it into my perl scrip.
I keep getting the error Use of uninitialized value in join or string at line xx.
Any tips or ideas? thank you
EDIT:
I may have an array of arrays that is being returned as my data type, how to I go into this to check it’s contents?
Here’s the solution we figured out in the chat:
Main problem were the spaces next to
' $test '.