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