"Fossies" - the Fresh Open Source Software Archive

Member "mod_perl-2.0.11/t/filter/TestFilter/in_str_lc.pm" (5 Oct 2019, 978 Bytes) of package /linux/www/apache_httpd_modules/mod_perl-2.0.11.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "in_str_lc.pm": 2.0.8_vs_2.0.9.

    1 # please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*-
    2 package TestFilter::in_str_lc;
    3 
    4 use strict;
    5 use warnings FATAL => 'all';
    6 
    7 use Apache2::RequestRec ();
    8 use Apache2::RequestIO ();
    9 use Apache2::Filter ();
   10 
   11 use TestCommon::Utils ();
   12 
   13 use Apache2::Const -compile => qw(OK M_POST);
   14 
   15 sub handler {
   16     my $filter = shift;
   17 
   18     while ($filter->read(my $buffer, 1024)) {
   19         #warn "FILTER READ: $buffer\n";
   20         $filter->print(lc $buffer);
   21     }
   22 
   23     return Apache2::Const::OK;
   24 }
   25 
   26 sub response {
   27     my $r = shift;
   28 
   29     $r->content_type('text/plain');
   30 
   31     if ($r->method_number == Apache2::Const::M_POST) {
   32         my $data = TestCommon::Utils::read_post($r);
   33         #warn "HANDLER READ: $data\n";
   34         $r->print($data);
   35     }
   36 
   37     Apache2::Const::OK;
   38 }
   39 1;
   40 __DATA__
   41 SetHandler modperl
   42 PerlModule          TestFilter::in_str_lc
   43 PerlResponseHandler TestFilter::in_str_lc::response