EvanK has asked for the wisdom of the Perl Monks concerning the following question:
sub authUser { # open two-way pipe to auth script (or die with an error) my($h,$in,$out,$err,$t); my @cmd = ( $pathToPerl, './auth.pl' ); eval { $h = harness(\@cmd, \$in, \$out, \$err, ( $t = timeout 5 ) ); start($h); $in = "$cUser\n$cPass\n"; pump($h) while length($in); ## Wait for all input to go pump($h) until $out =~ m/\n\x1E\x1E\x1D\x1E/; finish $h; } if( $@ ) { $h->kill_kill; die("failed to connect to authorization module: $@"); } }
__________
Give a man a match and he'll be warm for an hour. Set him on fire and he'll be warm for the rest of his life.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: identifying an IPC::Run + eval block error
by pg (Canon) on Aug 26, 2005 at 01:19 UTC | |
by EvanK (Chaplain) on Aug 27, 2005 at 01:41 UTC |