Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Once again epoptai++ for this really nice update.

Here's a patch for the mod_perl users which allows them to run framechat with mod_perl. This is really faster than the regular version because the whole script is only loaded once, and all the script has to do then is to fetch the XML and print it.

It is implemented as a Apache::Registry handler, if I got some time and if there's enough interest, I could maybe come up with a full blown Apache::Framechat for all the CB addicts around.

#!/usr/bin/perl open (CGI, $ARGV[0]) or die "Cannot open $ARGV[0]:$!\n"; open (MOD, "> mod_framechat.pl") or die "Cannot open mod_framechat.pl: +$!\n"; { local $/; $cgi = <CGI>; } # you know epoptai's spacebar sometime stuck... :P $cgi =~ s[my\s*%i\s*=\s*map\s*{\s*\$_\s*=>\s*param\(\$_\)}\s*param;][$ +&;\nsub mod_perl_run {]is; $cgi =~ s[</noframes></html>~;.exit][$&\n}]is; $cgi =~ s[^__END__][=cut]is; print MOD $cgi . "\n'mod_perl is cool.';"; open (MOD2, "> launch_framechat.pl") or die "Cannot open launch_framec +hat.pl:$!\n"; print MOD2 <<'__script__'; #!perl use strict; require "./mod_framechat.pl"; mod_perl_run(); __script__ print STDERR "Done. You can now run launch_framechat.pl!\n";

framechat2 mod-perl

#!/usr/bin/perl open (CGI, $ARGV[0]) or die "Cannot open $ARGV[0]:$!\n"; open (MOD, "> mod_framechat.pl") or die "Cannot open mod_framechat.pl: +$!\n"; { local $/; $cgi = <CGI>; } # you know epoptai's spacebar sometime stuck... :P $cgi =~ s[# mod_perl_patch_begin][# mod_perl_patch_begin\nsub mod_perl +_run {]is; $cgi =~ s[# mod_perl_patch_end][# mod_perl_patch_end\n}]is; print MOD $cgi . "\n1;"; open (MOD2, "> launch_framechat.pl") or die "Cannot open launch_framec +hat.pl:$!\n"; print MOD2 <<'__script__'; #!perl use strict; require "./mod_framechat.pl"; mod_perl_run(); __script__ print STDERR "Done. You can now run launch_framechat.pl!\n";

20010613 - update: Fixed the __END__ token problem, and returns a true value;

20010825 - update: Updated the patch for framechat2

<kbd>--
my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>

In reply to Re: framechat (mod_perl patch) by OeufMayo
in thread framechat by epoptai

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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Domain Nodelet?
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this?Last hourOther CB clients
    Other Users?
    Others wandering the Monastery: (4)
    As of 2024-09-20 20:34 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The PerlMonks site front end has:





      Results (26 votes). Check out past polls.

      Notices?
      erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.