File: printer_instance.pm

package info (click to toggle)
libapache-singleton-perl 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 236 kB
  • sloc: perl: 274; makefile: 13
file content (29 lines) | stat: -rw-r--r-- 468 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package TestApache::Singleton::Process::printer_instance;

use strict;
use warnings FATAL => 'all';
use constant MP2 => $mod_perl::VERSION >= 1.99;

use Printer::PerProcess;

if (MP2) {
    require Apache2::RequestRec;
    require Apache2::RequestIO;
}

sub handler {
    my $r = shift;

    $r->content_type('text/plain');
    if (!MP2) {
        $r->send_http_header;
    }

    my $printer = Printer::PerProcess->instance;

    $r->write("$printer");

    0;
}

1;