checkin v3.10
[perl/plp/.git] / PLP / Tie / Print.pm
1 #--------------------#
2  package PLP::Tie::Print;
3 #--------------------#
4 use strict;
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 {
17     return bless {}, $_[0];
18 }
19
20 sub WRITE { undef; }
21
22 sub PRINT {
23     my ($self, @param) = @_;
24     return if @param == 1 and not length $param[0];
25     PLP::sendheaders() unless $PLP::sentheaders;
26     print STDOUT @param;
27     select STDOUT;
28 }
29
30 sub PRINTF {
31     my ($self, @param) = @_;
32     printf STDOUT @param;
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 1;
47