perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Hazelden <weirdofr...@gmail.com>
Subject Re: INPUT_FUNC is hanging?
Date Thu, 30 Dec 2004 23:39:36 GMT
> You should give the full package name in your config e.g.
> 
> SetEnv EMBPERL_INPUT_FUNC main::configinput
> 
> If you function is defined in a different package then main::, then you have
> to specify the correct package name
> 
> Gerald

Thanks, that worked great.

Unfortunately, it seems to be affecting directory indexes as well.
Instead of giving me a list of the files, it asks me to download ("You
have chosen to open\n\n\nwhich is a: httpd/unix-directory").

For completeness' sake, the relevant lines in httpd.conf are
PerlRequire /home/phil/serv/cgi-bin/startup
PerlSetEnv EMBPERL_OPTIONS 16
PerlSetEnv EMBPERL_ESCMODE 0
PerlSetEnv EMBPERL_INPUT_FUNC main::configinput
AddHandler perl-script .html .epl
PerlHandler HTML::Embperl

And /home/phil/serv/cgi-bin/startup contains just
use warnings;
use strict;

sub configinput {
	my ($r, $in, $cacheargs) = @_;
	open my $f, $r->filename or return "NOT_FOUND";
	local $/ = undef;
	$$in = <$f>;
	close $f;
	$$cacheargs = -M $r->filename;
	0;
}
1;

If I comment out the INPUT_FUNC line it goes back to displaying the
indexes like normal. Any thoughts? Thanks again.

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message