jujiro_eb has asked for the wisdom of the Perl Monks concerning the following question:
I would once again greatly appreciate your help.use strict; use warnings; my $TEMP1; my $OLD_STDOUT_HANDLE; my $NEW_STDOUT_HANDLE; open NEW_STDOUT_HANDLE, ">&STDOUT"; close STDOUT; open STDOUT, ">", \$TEMP1; open my $pipe_fh, '|-', "sqlplus.exe -s scott/tiger\@butthead" or die "Can't open pipe: $!"; print {$pipe_fh} <<"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 ; close $pipe_fh; close STDOUT; open STDOUT, ">&NEW_STDOUT_HANDLE"; print "6.\n"; print $TEMP1;
Regards.
Ash
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question: Redirection of stdout to scalar variable
by ikegami (Patriarch) on Mar 20, 2009 at 21:41 UTC | |
by jujiro_eb (Sexton) on Mar 20, 2009 at 23:01 UTC | |
by syphilis (Archbishop) on Mar 21, 2009 at 02:24 UTC | |
|
Re: Question: Redirection of stdout to scalar variable
by almut (Canon) on Mar 20, 2009 at 21:34 UTC | |
|
Re: Question: Redirection of stdout to scalar variable
by merlyn (Sage) on Mar 20, 2009 at 21:13 UTC | |
|
Re: Question: Redirection of stdout to scalar variable
by Illuminatus (Curate) on Mar 20, 2009 at 21:14 UTC | |
|
Re: Question: Redirection of stdout to scalar variable
by kyle (Abbot) on Mar 23, 2009 at 15:11 UTC |