$sqlStr = "select createwbparserun('$directory','$filename')"; print "$sqlStr\n"; my $sth = $db_in->prepare($sqlStr); $sth->execute(); if (my @aRow = $sth->fetchrow_array) { print Dumper \@aRow; $wb_runkey = $aRow[0]; print "WORKBOOK run key: " . $wb_runkey . "\n"; } #### #... same preamble as before ... if (my $aRow = $sth->fetchrow_arrayref) { print Dumper $aRow; $wb_runkey = $aRow->[0]; print "WORKBOOK run key: " . $wb_runkey . "\n"; }