PPR

 view release on metacpan or  search on metacpan

lib/PPR.pm  view on Meta::CPAN

5.20, the C<decomment()> subroutine is not available when running under
these releases.


=head2 Examples

I<Note:> In each of the following examples, the subroutine C<slurp()> is
used to acquire the source code from a file whose name is passed as its
argument. The C<slurp()> subroutine is just:

    sub slurp { local (*ARGV, $/); @ARGV = shift; readline; }

or, for the less twisty-minded:

    sub slurp {
        my ($filename) = @_;
        open my $filehandle, '<', $filename or die $!;
        local $/;
        return readline($filehandle);
    }

lib/PPR/X.pm  view on Meta::CPAN

5.20, the C<decomment()> subroutine is not available when running under
these releases.


=head2 Examples

I<Note:> In each of the following examples, the subroutine C<slurp()> is
used to acquire the source code from a file whose name is passed as its
argument. The C<slurp()> subroutine is just:

    sub slurp { local (*ARGV, $/); @ARGV = shift; readline; }

or, for the less twisty-minded:

    sub slurp {
        my ($filename) = @_;
        open my $filehandle, '<', $filename or die $!;
        local $/;
        return readline($filehandle);
    }

t/document_self.t  view on Meta::CPAN

BEGIN{
    BAIL_OUT "A bug in Perl 5.20 regex compilation prevents the use of PPR under that release"
        if $] > 5.020 && $] < 5.022;
}


plan tests => 1;

use PPR;

my $source = do { local (@ARGV, $/) = $INC{'PPR.pm'}; readline; };

ok $source =~ m{ \A (?&PerlDocument) \Z  $PPR::GRAMMAR }xms => 'Matched own document';

done_testing();



( run in 0.611 second using v1.01-cache-2.11-cpan-49f99fa48dc )