$result=`sqlplus -s user/pass \@myfile`; if($result=~/(?:SP2|ORA)/){ print "SQL ERROR: $result\n"; }