This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse.pm: handle BEGIN { require expr }
Deparse examines BEGIN subs to see if they look like
BEGIN { require Foo; ... }
and if so deparses them as 'use Foo' instead.
However, it can't cope when Foo is an expression rather than a constant,
such as
BEGIN {
require($ENV{PERL_CORE} ? '../../t/test.pl' : './t/test.pl');
}
and crashes.
This commit makes it instead recognise such op trees as not being part of
a 'use'.
Under TEST -deparse, this fixes the following unexpectedly failing
script:
dist/threads/t/kill3.t
and fixes the following expected-to-fail scripts:
dist/IO/t/io_file_export.t
dist/IO/t/io_multihomed.t
dist/IO/t/io_udp.t
dist/threads/t/err.t
dist/threads/t/kill2.t
dist/threads/t/libc.t