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: $@"); } }