NAME

TAPx::Parser::Source::Perl - Stream Perl output

VERSION

Version 0.30

DESCRIPTION

Takes a filename and hopefully returns a stream from it. The filename should be the name of a Perl program.

SYNOPSIS

use TAPx::Parser::Source::Perl;
my $source = TAPx::Parser::Source::Perl->new;
my $stream = $source->filename($filename)->get_stream;

##############################################################################

METHODS

Class methods

new

my $source = TAPx::Parser::Source::Perl->new;

Returns a new TAPx::Parser::Source::Perl object.

Instace methods

filename

my $filename = $source->filename;
$source->filename($filename);

Getter/setter for the source filename. Will croak if the $filename does not appear to be a file.

switches

my $switches = $source->switches;
my @switches = $source->switches;
$source->switches(@switches);

Getter/setter for the additional switches to pass to the perl executable. One common switch would be to set an include directory:

$source->switches('-Ilib');

get_stream

my $stream = $source->get_stream;

Returns a stream of the output generated by executing filename.

error

unless ( my $stream = $source->get_stream ) {
    die $source->error;
}

If a stream cannot be created, this method will return the error.

exit

my $exit = $self->exit;

Returns the exit status of the process if and only if an error occurs in opening the file.