Randy Kobes wrote:
Hi,
   On Win32, the apache/subprocess tests fail on Win32.
This is due to the following: currently, the tests do
something like

   @argv = qw(potentially something);
   $command = catfile $target_dir, "some_script.pl";
   Apache::SubProcess::spawn_proc_prog($r, $command, [EMAIL PROTECTED]);

The problem on Win32 is that $command isn't associated with Perl.
To fix this, one could do one of two things.

- create a "some_script.bat" with pl2bat, use
   $command = catfile $target_dir, "some_script.bat";
and insert a
   $r->subprocess_env->set(PATH => $Config{bin});
before invoking the script.

- use
    $command = $Config{perlpath}; # or perhaps better $^X
    @list = ("some_script.pl", @argv);
    Apache::SubProcess::spawn_proc_prog($r, $command, [EMAIL PROTECTED]);
(the potentially nicer looking
    $command = "$Config{perlpath} some_script.pl";
    Apache::SubProcess::spawn_proc_prog($r, $command, [EMAIL PROTECTED]);
doesn't work - I think it interprets $command as one single
command - Win32 is famous for problems with quoting command-line
things).

Either of the above works - does anyone have a strong
preference one way or another?

I prefer 2nd, since it doesn't force us to modify the filename. However I'd check whether $Config{perlpath} works everywhere. Perhaps check perl test suite to see what it uses? I remember there was a discussion of may be using $^X. or both.


otherwise +1

Incidentally, for both, subtests 3 and 4 need
some massaging for line endings - either have
   my $value = "some text\r\n";
or use
   $output =~ s!\r!!;
Although, with perlio the :crlf filter would be
available, which would be neater ...

what about mac? there is no \r there. I guess we need to do what CGI.pm does or is there a standard module that defines $CRLF?


In any case we could probably always write "\r\n" (e.g. "some text\r\n") and then after reading the output do:

s/[\r\n]{1,2}/\r\n/;

and only then compare. Will that work?


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to