>>>>> "Sean" == Sean Chittenden <[EMAIL PROTECTED]> writes:

Sean>   Check to make sure that you compiled in the Init and Exit handlers
Sean> into mod_perl.

Sean>   If you include the following code in a script, you should be able
Sean> to figure this out really quick:

Sean>     require mod_perl;
Sean>     require mod_perl_hooks;
Sean>     my @retval = qw(<table>);
Sean>     my @list = mod_perl::hooks();
Sean>     for my $hook (sort @list) {
Sean>         my $on_off = 
Sean>           mod_perl::hook($hook) ? "<b>Enabled</b>" : "<i>Disabled</i>";
Sean>         push @retval, "<tr><td>$hook</td><td>$on_off</td></tr>\n";
Sean>     }
Sean>     push @retval, qw(</table>);

Sean>     print @retval;

Ewww... Too many pushes. :)

    require mod_perl;
    require mod_perl_hooks;
    print "<table>",
      (map {
        "<tr><td>", $_, "</td><td>",
        (mod_perl::hook($_) ? "<b>Enabled</b>" : "<i>Disabled</i>"),
        "</td></tr>\n" } mod_perl::hooks()),
      "</table>";

map is your friend.  Of course, this would have been even simpler with
CGI.pm HTML generators. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to