Have you tried using dbms_output_get? Or creating a function/procedure with an explicit return (alternatively as an output parameter) of the value you want?
Show us your code so far.
Update: Added function/procedure clarification.
--
Andreas
Comment on Re: Return value from PL/SQL block Using perl