use warnings in all modules
[perl/plp/.git] / lib / PLP / Tie / Print.pm
1 package PLP::Tie::Print;
2
3 use strict;
4 use warnings;
5
6 =head1 PLP::Tie::Print
7
8 Just prints to stdout, but sends headers if not sent before.
9
10     tie *HANDLE, 'PLP::Tie::Print';
11
12 This module is part of the PLP Internals and probably not of much use to others.
13
14 =cut
15
16 sub TIEHANDLE { bless \my $dummy, $_[0] }
17
18 sub WRITE { undef }
19
20 sub PRINT {
21         shift;
22         return unless grep length, @_;
23         PLP::sendheaders() unless $PLP::sentheaders;
24         print STDOUT @_;
25         select STDOUT;
26 }
27
28 sub PRINTF {
29         shift;
30         return unless length $_[0];
31         PLP::sendheaders() unless $PLP::sentheaders;
32         printf STDOUT @_;
33         select STDOUT;
34 }
35
36 sub READ { undef }
37
38 sub READLINE { undef }
39
40 sub GETC { '%' }
41
42 sub CLOSE { undef }
43
44 sub UNTIE { undef }
45
46 sub DESTROY { undef }
47
48 1;
49