Since I am using Active Perl (Win32), IPC::Run did not show up in my package manager. I managed to use IPC::Run3 for the same. Thanks so much for the help. By the way the reason for all this is that dbms_output.put_line adds an extra LF at the end. I needed to strip it out. So the final code looks like this:
Thanks again everybody!use strict; use warnings; use IPC::Run3; my @cmd = qw( sqlplus.exe -s scott/tiger@butthead ); my $in = <<'__END_OF_SQL__'; set echo off set lines 1000 set trims on set serverout on size 999999 set feed off exec dbms_output.put_line('Hello There'); exit; __END_OF_SQL__ run3 \@cmd, \$in, \my $out; print $out;
Ash
In reply to Re^2: Question: Redirection of stdout to scalar variable
by jujiro_eb
in thread Question: Redirection of stdout to scalar variable
by jujiro_eb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |