Help in getting pl/sql output messages in script

Hi ,

I have a pl/sql procedure which takes its input from a shell script, and deletes rows from db table based on the input.
I've dbms_output.put_line statments in procedure which i want to capture and display in the script and change the course of the execution of the script.

for example, if no rows have been deleted, i have to stop executing the rest of the script.

the issue is that the dbms_output statements are not displayed on the screen even when the serveroutput is on

Can anyone give me ideas on how to implement this.

set serveroutput on

declare
begin
DBMS_OUTPUT.ENABLE(1000000);
DBMS_OUTPUT.PUT_LINE('This is a very very bad habit to use DBMS_OUTPUT - I should never ever use it as it is a bad thing');
DBMS_OUTPUT.PUT_LINE('I can insert into some table instead using PRAGMA for autonomous transaction');
end;

Note the DBMS_OUTPUT.ENABLE. You might be interested in Perl and DBI module as well... I would suggest that (and I suggest python rather than Perl).