use strict; use warnings; use English '-no_match_vars'; open my $pipe_fh, '|-', 'sqlplus.exe -s uid/pwd@myserver' or die "Can't open pipe: $!"; print {$pipe_fh} ; close $pipe_fh or die "close failed: $!"; if ( $CHILD_ERROR ) { die "sqlplus returned non-zero exit status '$CHILD_ERROR'"; } __DATA__ select * from emp; exit;