On Sep 15, 10:15 pm, [EMAIL PROTECTED] (Jeff Pang) wrote:
> 2008/9/15 JMJ <[EMAIL PROTECTED]>:
>
> > I need to open a program which I decided to use system but how do I
> > stay in there and use variables to populate.
>
> use a open:
>
> open HD, "external_command|" or die $!;
> while(<HD>) {
> my $output_line = $_;
> ...}
>
> close HD;
>
> The external_command will be run in a child, the parent will block
> until the child die or exit, so you could let external_command always
> run there and get its output in parent.
I had wrote something similar to that. I'm actually writing a perl
program that will pull a password with a specific command that I use.
Then I need that password to pull into another program for the Oracle
listener. This is difficult b/c the listener throws tty errors if yo
just try to pass it a variable as a default value.
So here are the basic steps:
Pull password from a call I make to the program that I already have.
Its a command line command that pulls from a certain app that we use
for that.
This is the part I need to automate so the user does not have to type
anything.
then login to the listener and put in change_password
LSNRCTL> change_password
it prompts you for the old_password which has to be left blank.
LSNRCTL> enter in old_password: (by hand you would hit return here)
then it prompts for the new_password
LSNRCTL> new Password ( this is where the password we pulled earlier
needs to be put in automatic)
LSNRCTL> re-type new password
The listener is funny in a way that it wants after you type in
change_password to actually be doing it using tty, which we are trying
tom do away with.
Here's what I had similar to yours:
open (X, "command_that_I_call |");
$the_pass = <X>;
close (X):
print $the_pass. This was to test if it was pulling the correct
pswrd, which it was.
Any help would be great.
Thanks,
J
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/