Re: using open3 to interact with external program--ANSWER FOUND

2005-06-13 Thread D. J. Birkett
OK thanks to Zentara, my code now looks like... #!/usr/bin/perl use warnings; use strict; use IPC::Open3; local $SIG{CHLD} = 'IGNORE'; local $SIG{PIPE} = 'IGNORE'; my $childpid = open3(\*IN, \*OUT, \*ERR, 'gpg --no-greeting --no-tty --command-fd 0 --status-fd 1 --edit root'); print IN "tru

Re: using open3 to interact with external program--ANSWER FOUND

2005-06-09 Thread John W. Krahn
zentara wrote: On Wed, 08 Jun 2005 09:24:43 +0100, [EMAIL PROTECTED] (D. J. Birkett) wrote: Thomas Bätzler wrote: D. J. Birkett <[EMAIL PROTECTED]> asked: OK I've tried altering my code as you suggested, replacing the regexes with ones that would work. gpg still just sits there as soon as

Re: using open3 to interact with external program

2005-06-08 Thread JupiterHost.Net
Here is what I now have... use IPC::Open3; use strict; use warnings; before IPC::Open3 local(*HIS_IN, *HIS_OUT, *HIS_ERR); $childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, 'gpg --edit root'); Make sure open3 worked open3(...) or die $!; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: using open3 to interact with external program

2005-06-08 Thread Wiggins d'Anconia
D. J. Birkett wrote: > Thomas Bätzler wrote: > >> D. J. Birkett <[EMAIL PROTECTED]> asked: >> >>> OK I've tried altering my code as you suggested, replacing the >>> regexes with ones that would work. gpg still just sits there as soon >>> as it has entered it's intereactive mode, and perl doesn't

Re: using open3 to interact with external program

2005-06-08 Thread D. J. Birkett
Zentara wrote: Since you are not showing us your code, we can only guess. My guess is that you are not setting up the gpg command properly. Here is what I now have... use IPC::Open3; local(*HIS_IN, *HIS_OUT, *HIS_ERR); $childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, 'gpg --edit root'); sle

Re: using open3 to interact with external program

2005-06-08 Thread D. J. Birkett
Thomas Bätzler wrote: D. J. Birkett <[EMAIL PROTECTED]> asked: OK I've tried altering my code as you suggested, replacing the regexes with ones that would work. gpg still just sits there as soon as it has entered it's intereactive mode, and perl doesn't seem to be passing any commands to it

RE: using open3 to interact with external program

2005-06-07 Thread Thomas Bätzler
D. J. Birkett <[EMAIL PROTECTED]> asked: > OK I've tried altering my code as you suggested, replacing > the regexes with ones that would work. gpg still just sits > there as soon as it has entered it's intereactive mode, and > perl doesn't seem to be passing any commands to it at all. > > Any

Re: using open3 to interact with external program

2005-06-07 Thread D. J. Birkett
Zentara wrote: Something along these lines print HIS_IN "trust\n"; chomp(my $answer = ); if( $answer =~ /^How many years?$/ ) { print HIS_IN "5\n"; }else{print "years error $!\n"; exit} chomp(my $answer1 = ); if( $answer1 =~ /^Are you sure?$/ ) { print HIS_IN "yes\n"; }else{prin