This will probably be a Homer S. Doh... but why doesn't this exit. It prints the Match... and the error mesg I have in a separate function then I see the ..passed print.. If tried exit as well.
Thanks for any/all help
sub getsql{
my $dbh = shift;
my $script = shift;
my $insert= shift;
local $/ = undef;
open FILE, '<', $script, or die "Couldn't open SQL file";
my $insql = dwindex(<FILE>);
my $outsql;
if (length $insert) {
$outsql = getinserts($insql,$insert);
}
else {
print "in else:$insql\n";
if ($insql =~ m/.*~\w+~.*/) {print "MATCHED IT\n";}
errmsg(1) && die if ($insql =~ m/.*~\w+~.*/);
print "pased*********************\n";
$outsql = $insql;
}
close FILE;
return $outsql;
}
In reply to no exit!
by doc1623