Data-Dump-HTML-PopUp

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    code will keep compatibility with Perl 5.10.0. This is used in the
    following ways:

    *   passed to Regexp::Stringify

    *   when dumping code references

        For example, in perls earlier than 5.016, feature.pm does not
        understand:

         no feature ':all';

        so we replace it with:

         no feature;

  $Data::Dump::HTML::PopUp::OPT_REMOVE_PRAGMAS
    Bool, default: 0.

    If set to 1, then pragmas at the start of coderef dump will be removed.
    Coderef dump is produced by B::Deparse and is of the form like:

lib/Data/Dump/HTML/PopUp.pm  view on Meta::CPAN

    };

    my $res = $deparse->coderef2text($code);

    my ($res_before_first_line, $res_after_first_line) =
        $res =~ /(.+?)^(#line .+)/ms;

    if ($OPT_REMOVE_PRAGMAS) {
        $res_before_first_line = "{";
    } elsif ($OPT_PERL_VERSION < 5.016) {
        # older perls' feature.pm doesn't yet support q{no feature ':all';}
        # so we replace it with q{no feature}.
        $res_before_first_line =~ s/no feature ':all';/no feature;/m;
    }
    $res_after_first_line =~ s/^#line .+//gm;

    $res = "sub" . $res_before_first_line . $res_after_first_line;
    $res =~ s/^\s+//gm;
    $res =~ s/\n+//g;
    $res =~ s/;\}\z/}/;
    $res;
}

lib/Data/Dump/HTML/PopUp.pm  view on Meta::CPAN

will keep compatibility with Perl 5.10.0. This is used in the following ways:

=over

=item * passed to L<Regexp::Stringify>

=item * when dumping code references

For example, in perls earlier than 5.016, feature.pm does not understand:

 no feature ':all';

so we replace it with:

 no feature;

=back

=head2 $Data::Dump::HTML::PopUp::OPT_REMOVE_PRAGMAS

Bool, default: 0.



( run in 0.319 second using v1.01-cache-2.11-cpan-cba739cd03b )