This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Porting/bench.pl: fix 'do' without '.' in @INC
authorDavid Mitchell <davem@iabyn.com>
Mon, 3 Apr 2017 16:03:42 +0000 (17:03 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 7 Apr 2017 13:42:24 +0000 (14:42 +0100)
The --benchfile arg (default t/perf/benchmarks) is supposed to be loaded
via 'do'. With '.' no longer in @INC by default, it doesn't find files
with relative paths.

Porting/bench.pl

index b073a01..efff214 100755 (executable)
@@ -504,7 +504,11 @@ sub filter_tests {
 sub read_tests_file {
     my ($file) = @_;
 
-    my $ta = do $file;
+    my $ta;
+    {
+        local @INC = ('.');
+        $ta = do $file;
+    }
     unless ($ta) {
         die "Error: can't parse '$file': $@\n" if $@;
         die "Error: can't read '$file': $!\n";