You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Weirdofreak Sixty-four <we...@gmail.com> on 2004/12/26 00:18:21 UTC
INPUT_FUNC is hanging?
I'm trying to set up an INPUT_FUNC, but I can't work out where to put
my configinput subroutine. My first thought was the startup.pl file,
but it gives the error that it can't find the
HTML::Embperl::configinput.al file in @INC. So I put the subrouting in
configinput.al which I moved to the right directory, and now it just
hangs. It won't do anything, I'm just constantly waiting - and this is
localhost. I don't get an error in my logs, apart from the one about
session handling ('can't locate Apache/SessionX.pm in @INC'), which I
get anyway - could it be something to do with that?
The actual subroutine is currently just the example one from the
documentation, and I'm not doing anything in startup.pl (I don't even
have one any more). Any ideas? TIA.
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
RE: INPUT_FUNC is hanging?
Posted by Gerald Richter <ri...@ecos.de>.
Hi,
>
> 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").
>
Wrapping your config stuff inside a
<Files *.epl>
</Files>
(you may vary the extention, or use FilesMatch for multiple extentions),
should prevent Apache from calling Embperl in the directory case
Gerald
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: INPUT_FUNC is hanging?
Posted by Philip Hazelden <we...@gmail.com>.
> 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
RE: INPUT_FUNC is hanging?
Posted by Gerald Richter <ri...@ecos.de>.
>
> I'm trying to set up an INPUT_FUNC, but I can't work out
> where to put my configinput subroutine. My first thought was
> the startup.pl file, but it gives the error that it can't
> find the HTML::Embperl::configinput.al file in @INC. So I put
> the subrouting in configinput.al which I moved to the right
> directory, and now it just hangs.
Xxx.al is only for autoloading, that's not the place to put any code by your
self. (see Perl's autosplit feature).
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
---------------------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
IT-Securitylösungen * Webapplikationen mit Apache/Perl/mod_perl/Embperl
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: richter@ecos.de Voice: +49 6133 939-122
WWW: http://www.ecos.de/ Fax: +49 6133 939-333
---------------------------------------------------------------------------
ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
---------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org