File: TieOut.pm

package info (click to toggle)
libmasonx-interp-withcallbacks-perl 1.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 228 kB
  • sloc: perl: 1,784; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (14)
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 TieOut;

# This module is swiped and adapted from ExtUtils::MakeMaker.

sub TIEHANDLE { bless [], ref $_[0] || $_[0] }

sub PRINT {
    my $self = shift;
    push @$self, join '', @_;
}

sub PRINTF {
    my $self = shift;
    push @$self, sprintf @_;
}

sub READLINE {
    my $self = shift;
    return shift @$self;
}

sub read {
    my $self = shift;
    my $ret = join '', @$self;
    @$self = ();
    return $ret;
}

1;