begin forbesc.test_exception_pg.main('orafail'); end; / exit #### #!/usr/bin/perl -w my $sqlplus = "sqlplus -s chuckster/im_in\@develo"; my $file = "\@/home/prodadm/scripts/run_package.sql"; my $var = (system($sqlplus . " " . $file)); my $out = $? >> 8; print "The out value is '$out'.\n"; #### [prodadm@ora4 scripts]$ ./invoke_sqlplus.pl begin * ERROR at line 1: ORA-01476: divisor is equal to zero ORA-06512: at "FORBESC.TEST_EXCEPTION_PG", line 12 ORA-06512: at line 2 The out value is '0'.