Here is a code fragment from one of my working perl scripts. Please let me know if the answers your question.
$sth_output = $dbh_orac->prepare("BEGIN dbms_output.get_line(:line, :status); END;");
my ($line, $status) = (" ", 0);
$sth_output->bind_param_inout(":line", \$line, 100);
$sth_output->bind_param_inout(":status", \$status, 100);
while ($status == 0) {
$sth_output->execute();
print "$line\n";
}