The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

VERSION

Version 0.50_01

DESCRIPTION

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

Note that this is a subclass of TAPx::Parser::Source. See that module for more methods.

SYNOPSIS

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

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

METHODS

Class methods

new

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

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

Instance methods

source

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

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

synch_output

  $perl->synch_output(1);
  my $synched = $perl->synch_output;

Warning! This feature is highly experimental. Due to the way that Test::Builder works, STDOUT and STDERR are not always in synch. Passing this method a true value will override the normal settings of Test::Builder and force regular output and failure output to go to the same filehandle. This means that you will no longer have to worry about failure messages being out of synch with your normal test output.

Unfortunately, due to a bug I have not been able to track down, that causes nicely formatted diagnostic messages like this:

 #   in examples/t/10-stuff.t at line 8.
 #     Structures begin differing at:
 #          $got->[0] = '2'
 #     $expected->[0] = '3'

To appear like this:

 # in examples/t/10-stuff.t at line 8.
 # Structures begin differing at:
 # $got->[0] = '2'
 # $expected->[0] = '3'

Patches are extremely welcome.

switches

 my $switches = $perl->switches;
 my @switches = $perl->switches;
 $perl->switches(\@switches);

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

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