Hi YuanYou, Thanks .. that one works alright ...
Uru: - Sorry, can't use DBI/DBD. I wish I can but unfortunately, am not allowed to install any additional modules. I've passed on that request to the SA already and hopefully, he will install it. I need to learn how to use it too, eventually I guess ... :-) - BTW, what are lexical file handles, am Googling at the moment, but confused ... :-) On Thu, May 27, 2010 at 5:26 PM, Uri Guttman <u...@stemsystems.com> wrote: > >>>>> "yy" == yuanyou yao <yaoyuan...@gmail.com> writes: > > yy> Can you please try > yy> open(ORA, "| dgmgrl | tee dgmgrl.out" ) ? > > this begs the whole question of why the OP isn't using DBI. > > yy> 2010/5/27 newbie01 perl <newbie01.p...@gmail.com>: > >> Hi all, > >> > >> Can someone please help and advise if it is possible to have the output > of > >> the code below to the screen and at the same time to the file as well? > >> > >> open(ORA, "| dgmgrl > dgmgrl.out" ) or die "Can't pipe to dgmgrl: $!"; > >> print ORA "connect > >> sys/passw...@${connect_string_02}\n<sys/password@ > $%7Bconnect_string_02%7D\n> > >> "; > > first off, use lexical file handles. secondly, use the DBI/DBD module > instead of using a cli program to talk to a dbms. then you can get the > db output in perl and decide where to print it. > > uri > > -- > Uri Guttman ------ u...@stemsystems.com -------- http://www.sysarch.com-- > ----- Perl Code Review , Architecture, Development, Training, Support > ------ > --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com--------- >