Ask a Question related to PERL Miscellaneous, Design and Development.
-
PapaBear #1
Catching Apache error with a Perl script
Hi y'all,
I'm handling Apache errors through seperate shtml files. That surely looks
better than the standard error pages by the browser etc. I did this by
coding in httpd.conf lines like:
ErrorDocument 403 [url]http://levi.prodeo/errors/err_403.shtml[/url]
ErrorDocument 404 [url]http://levi.prodeo/errors/err_404.shtml[/url]
ErrorDocument 405 [url]http://levi.prodeo/errors/err_405.shtml[/url]
etcetera.
Now, I would like to handle those through a Perl script file.
For that purpose I coded in httpd.conf lines like:
ErrorDocument 404 [url]http://levi.prodeo/cgi-bin/http_err.pl?err=403[/url]
ErrorDocument 404 [url]http://levi.prodeo/cgi-bin/http_err.pl?err=404[/url]
ErrorDocument 405 [url]http://levi.prodeo/cgi-bin/http_err.pl?err=405[/url]
It does not complain about this URL, but the big question is:
How do I get that error number into my Perl program?
Please spare me the CPAN modules, I think they're overweight. I'd like to
see what I'm coding, so simple solutions if possible...
Tnx in advance,
PapaBear
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/CS/CM/O d+(--) s++:+>: a? C++(+++)$ UL++(+++) P++>+++ L++>+++ E- W+++$
N++ !o !K w !O M- V? PS->$ PE+(-) Y+ PGP t+ 5? !X R- tv b+(+++) DI? !D G(-)
!e h---- r+++ y?
------END GEEK CODE BLOCK------
[url]http://www.geekcode.com[/url]
__________________________________
Never mind the bear, beware of Papa!
PapaBear Guest
-
catching script errors in PSQL and redirecting to file?
Hi, I have a problem catching the output of my scripts into the file. For example I have a set of scripts to create my schema. In psql I just... -
Apache returns 200 OK, but my perl script sends 302 REDIRECT
On Thu, Aug 21, Michel Tokic inscribed on the eternal scroll: If you were sure about that, then why ask here? (i.e c.l.p.m).... -
Strange INC error when using perl 5.8.0 as a cgi script
Hi All, I have just compiled perl 5.8.0 on aix 4.3.3. I got the stable.tar from cpan. It complied fine without any errors. The trouble starts... -
Apache mod_rewrite/RewriteMap prg: and perl script
Sorry for the x-posting, but sometimes I just gotta do it! So many redundant-seeming newsgroups and all... Anyways, I have a server as follows:... -
Problem executing a BAT file (or EXE file) using Perl as CGI script under Apache.
I have developed some perl code to run as a script under Windows 2000 running apache. This works GREAT on Win2k but on WinNT, perl is simply... -
PapaBear #2
Re: Catching Apache error with a Perl script
Brian Wakem <no@email.com> schreef in berichtnieuws
bhvku6$3m44b$1@ID-112158.news.uni-berlin.de...That works like a charm, tnx a lot Brian!>
> my ($error_number) = $ENV{QUERY_STRING} =~ /err=(\d+)/;
>
___________________________________
Never mind the Bear, beware of papa...
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/CS/CM/O d+(--) s++:+>: a? C++(+++)$ UL++(+++) P++>+++ L++>+++ E- W+++$
N++ !o !K w !O M- V? PS->$ PE+(-) Y+ PGP t+ 5? !X R- tv b+(+++) DI? !D G(-)
!e h---- r+++ y?
------END GEEK CODE BLOCK------
[url]http://www.geekcode.com[/url]
PapaBear Guest
-
Tony #3
Re: Catching Apache error with a Perl script
"PapaBear" <Papabear@Filternet.nl> wrote in message news:<bhvk23$d56$1@news>...
> Hi y'all,
>
> I'm handling Apache errors through seperate shtml files. That surely looks
> better than the standard error pages by the browser etc. I did this by
> coding in httpd.conf lines like:
>
> ErrorDocument 403 [url]http://levi.prodeo/errors/err_403.shtml[/url]
> ErrorDocument 404 [url]http://levi.prodeo/errors/err_404.shtml[/url]
> ErrorDocument 405 [url]http://levi.prodeo/errors/err_405.shtml[/url]
>
> etcetera.
>
>
> Now, I would like to handle those through a Perl script file.
> For that purpose I coded in httpd.conf lines like:
>
> ErrorDocument 404 [url]http://levi.prodeo/cgi-bin/http_err.pl?err=403[/url]
> ErrorDocument 404 [url]http://levi.prodeo/cgi-bin/http_err.pl?err=404[/url]
> ErrorDocument 405 [url]http://levi.prodeo/cgi-bin/http_err.pl?err=405[/url]
>
> It does not complain about this URL, but the big question is:
>
> How do I get that error number into my Perl program?
>
>
> Please spare me the CPAN modules, I think they're overweight. I'd like to
> see what I'm coding, so simple solutions if possible...
>
> Tnx in advance,
>
> PapaBear
>
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.1
> GAT/CS/CM/O d+(--) s++:+>: a? C++(+++)$ UL++(+++) P++>+++ L++>+++ E- W+++$
> N++ !o !K w !O M- V? PS->$ PE+(-) Y+ PGP t+ 5? !X R- tv b+(+++) DI? !D G(-)
> !e h---- r+++ y?
> ------END GEEK CODE BLOCK------
> [url]http://www.geekcode.com[/url]
> __________________________________
> Never mind the bear, beware of Papa!
if you are calling the page like [url]http://levi.prodeo/cgi-bin/http_err.pl?err=405[/url]
I would have though that you could just do something like this
#!/usr/bin/perl
use CGI qw(:standard);
$ErrorCode = param('err');
## do what ever on value of $ErrorCode
Regards
Tony
Tony Guest



Reply With Quote

