CGI-apacheSSI

 view release on metacpan or  search on metacpan

lib/CGI/apacheSSI.pm  view on Meta::CPAN

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use Cwd;
 
our $VERSION = '0.96';
 
our $DEBUG = 0;
 
sub import {
    my($class,%args) = @_;
    return unless exists $args{'autotie'};
    $args{'filehandle'} = $args{'autotie'} =~ /::/ ? $args{'autotie'} : caller().'::'.$args{'autotie'};
    no strict 'refs';
    my $self = tie(*{$args{'filehandle'}},$class,%args);
    return $self;
}
 
my($gmt,$loc,$lmod);
 
                        # NOTE: check for escaped \( or \), what should it do? -- DONE?
our $L; # used to return the brackets count
our $RE_parens_2C = qr/

lib/CGI/apacheSSI.pm  view on Meta::CPAN

143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
    my $self = shift;
    $self->{'_config'}->{'_enable_exec_cmd'} = $_[0];
}
 
sub TIEHANDLE {
    my($class,%args) = @_;
    my $self = $class->new(%args);
    $self->{'_handle'} = do { local *STDOUT };
    my $handle_to_tie = '';
    if($args{'filehandle'} !~ /::/) {
                $handle_to_tie = caller().'::'.$args{'filehandle'};
    } else {
                $handle_to_tie = $args{'filehandle'};
    }
    open($self->{'_handle'},'>&'.$handle_to_tie) or die "Failed to copy the filehandle ($handle_to_tie): $!";
    return $self;
}
 
sub PRINT {
    my $self = shift;
    print {$self->{'_handle'}} map { $self->process($_) } @_;



( run in 0.332 second using v1.01-cache-2.11-cpan-0f795438458 )