Hello Monks. I've been banging my head against my desk for hours trying to figure out how to use the timeout method from Apache2::ServerRec. The synopsis for this says you can do:
use Apache2::ServerRec (); $timeout = $s->timeout();
Where does $s come from? I've looked into handlers, thinking that was the solution, but I can't get anything to work. Aaaahh! Any help would really be appreciated. Thanks!

Update: I thought you might want to know what my latest attempt was. The perl I have is:
#!/opt/local/bin/perl package MyApache2::Timeout; use strict; use warnings; use CGI::Carp qw{fatalsToBrowser}; use Apache2::ServerRec(); use Apache2::Const -compile => qw{OK}; sub handler { my $r = shift; $r->content_type('text/plain'); my $timeout = $r->timeout(); return Apache2::Const::OK; } 1;
And in httpd.conf:
PerlModule MyApache2::Timeout <Location /timeout> SetHandler modperl PerlResponseHandler MyApache2::Timeout </Location>
When I go to http://localhost/timeout, I get an internal server error (no details like I would expect from using CGI::Carp). I know that MyApache2::Timeout is being loaded because if I comment out the my $timeout = $r->timeout(); line and restart Apache, I get no error.

In reply to Apache2::ServerRec Cluelessness by sstevens

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.