File: TieHandle.pm

package info (click to toggle)
libmason-perl 2.24-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 748 kB
  • sloc: perl: 4,882; makefile: 7
file content (29 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (3)
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 Mason::TieHandle;
$Mason::TieHandle::VERSION = '2.24';
use strict;
use warnings;

sub TIEHANDLE {
    my $class = shift;

    return bless {}, $class;
}

sub PRINT {
    my $self = shift;

    # TODO - why do we need to select STDOUT here?
    my $old = select STDOUT;
    $Mason::Request::current_request->print(@_);
    select $old;
}

sub PRINTF {
    my $self = shift;

    # apparently sprintf(@_) won't work, it needs to be a scalar
    # followed by a list
    $self->PRINT( sprintf( shift, @_ ) );
}

1;