Re: Writing to stdin of subprocess under modperl 1.0 fails :/

2003-01-14 Thread Antti Haapala


> Use IPC::Run instead of the IPC::Open* family, it surely works and a much
> more flexible tool!

Thanks for advice. Tried it and it worked!

-- 
Antti Haapala




Writing to stdin of subprocess under modperl 1.0 fails :/

2003-01-13 Thread Antti Haapala

Hello all,

I'm having trouble with following script under mod_perl
1.26 (perl 5.6.1).

use strict ();
use IO::Handle ();
use IPC::Open2 ();

###
#
# Check $username & $password against YP database
sub check_password {
my ($username, $passwd) = @_;

my($rh, $wh);

# open bi-dir pipe
my $pid = IPC::Open2::open2($rh, $wh,
"/usr/local/bin/ypmatch_by_ilmo", $username);

$write->printflush("$passwd\n");

my $ret = <$read>;

close($write);
close($read);

waitpid $pid, 0;

return $ret;
}

This snippet works as expected when run from command line. When run under
mod_perl the program spawned by open2 receives nothing but EOF from its
stdin, but is still able to provide its output to caller process.

What I'm doing wrong? Is there something similar to
Apache::SubProcess::spawn_proc_prog in MP1.x?

-- 
Antti Haapala





Re: Novice - Problem with data encoding

2002-11-01 Thread Antti Haapala

> I have an XML doc that I generated using XML::LibXML that needs to be
> included as a hidden form field in a form post.
>
> The problem is that the browser is encoding the XML doc.
>
> ie.
> 
> http://gftd/schemas/data.dtd";>
>
> turns into:
> <?xml version="1.0" encoding="UTF-8"?>
> <DOCTYPE gtfd SYSTEM "http://gftd/schemas/data.dtd">;
>
> which blows up in the parsing.  If I edit the result and swap back the <
> and " it works. How can I prevent the encoding of the XML data?

You have probably escaped the xml snippet twice yourself - check the code
of the page from your browser. If you see the value of your hidden field
as "&lt;?xml...", you have done double escaping.

Just remove one of the escaping passes and it should work.

The browser isn't supposed to do any such encoding on its own. If it does
you need to change your browser. You aren't using Netscape 4.0, are you?

-- 
Antti Haapala




Apache::AuthCookie in mod_perl 1.99_5

2002-10-17 Thread Antti Haapala


I recently started testing experimental mod_perl 2.0, and almost
immediately run into following problem:

Apache::AuthCookie (3.04) wants to set auth_type of
connection/request/whatever, but there no longer exists any method in
Apache::blahblah that allows me to set the auth_type/auth_name of
request/connection. There's still corresponding method to _GET_ the
auth_type/auth_name, but it doesn't allow setting them any more. I haven't
looked the module thoroughly so I haven't figured yet, whether this is
needed or not.

Any comments?