File tree Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Expand file tree Collapse file tree 2 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -1151,19 +1151,20 @@ sub check_hints {
11511151}
11521152
11531153sub _run_hintfile {
1154- my ($self , $hint_file ) = @_ ;
1154+ our $self ;
1155+ local ($self ) = shift ; # make $self available to the hint file.
1156+ my ($hint_file ) = shift ;
11551157
11561158 local ($@ , $! );
11571159 print " Processing hints file $hint_file \n " if $Verbose ;
11581160
1159- if (open (my $fh , ' <' , $hint_file )) {
1160- my $hints_content = do { local $/ ; <$fh > };
1161- no strict;
1162- eval $hints_content ;
1163- warn " Failed to run hint file $hint_file : $@ " if $@ ;
1164- }
1165- else {
1166- warn " Could not open $hint_file for read: $! " ;
1161+ # Just in case the ./ isn't on the hint file, which File::Spec can
1162+ # often strip off, we bung the curdir into @INC
1163+ local @INC = (File::Spec-> curdir, @INC );
1164+ my $ret = do $hint_file ;
1165+ if ( !defined $ret ) {
1166+ my $error = $@ || $! ;
1167+ warn $error ;
11671168 }
11681169}
11691170
Original file line number Diff line number Diff line change 6161 local $SIG {__WARN__ } = sub { $stderr .= join ' ' , @_ };
6262
6363 $mm -> check_hints;
64- my $Escaped_Hint_File = quotemeta ($Hint_File );
65- like( $stderr , qr { ^Failed to run hint file $Escaped_Hint_File : Argh!\n\z } , ' hint files produce errors' );
64+ is( $stderr , <<OUT , ' hint files produce errors' );
65+ Argh!
66+ OUT
6667}
6768
6869END {
You can’t perform that action at this time.
0 commit comments