%use IPC::Run3;
%my $a;
%run3 ['echo','hello'],\undef,\$a;
<% $a %>
Above mason
code works very well when I use Mason
from a standalone script, as descriped in HTML::Mason::Admin
. Unfortunately, when running with perl_mode
, $a
is an empty string. Below is my httpd.conf
Alias /mason_book /home/charlse/f/books/mason_book
<Location /mason_book>
SetHandler perl-script
AddHandler perl-script .mas
PerlHandler HTML::Mason::ApacheHandler
PerlAddVar MasonCompRoot "mason_book => /home/charles/f/books/mason_book"
</Location>
<Directory "/home/chunywan/f/books/mason_book">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
BTW
%use IPC::Run qw(run timeout);
%my @cmd=qw(echo hello world);
%my ($in,$out,$err);
%run(\@cmd, \$in, \$out, \$err) or die "cat: $?";
<pre>
out <% $out %>
</pre>
I just try IPC::Run
which works very well in both standalone mode and mod_perl
mode.
It seems that I have to update all my source code to use IPC::Run
instead of IPC::Run3
.