Data-Dmp
view release on metacpan or search on metacpan
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::Dmp::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/Dmp.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/Dmp.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::Dmp::OPT_REMOVE_PRAGMAS
Bool, default: 0.
( run in 0.431 second using v1.01-cache-2.11-cpan-cba739cd03b )