It seems that gcc produces this:
$ ./perl -Ilib -e 'warn $^X'
/Users/sprout/Perl/perl.git/perl at -e line 1.
while g++ produces this:
$ ./perl -Ilib -e 'warn $^X'
./perl at -e line 1.
(I may be misdiagnosing this, but I have two blead builds that give
different values for $^X.)
The script is using $^X for testing, which is why it could produce
different results.
In any case, this produces the same output for both compilers:
use File::stat;
my $stat = File::stat::stat('./perl');
warn eval '-l $stat';
warn eval '-l "./perl"';
__END__
Warning: something's wrong at - line 3.
1 at - line 4.
The test is wrong, as -l _ will fail after a stat. You have to do
lstat for -l _ to work. Similarly, -l $stat_obj should only return
true if the $stat_obj was returned by File::stat::lstat.
This commit adjusts the test accordingly.
my ($file, $desc_tail, $skip) = @_;
my @stat = CORE::stat $file;
my $stat = File::stat::stat($file);
+ my $lstat = File::stat::lstat($file);
isa_ok($stat, 'File::stat', 'should build a stat object');
for my $op (split //, "rwxoRWXOezsfdlpSbcugkMCA") {
note("Not testing -A $desc_tail");
next;
}
+ my $stat = $op eq 'l' ? $lstat : $stat;
for my $access ('', 'use filetest "access";') {
my ($warnings, $awarn, $vwarn, $rv);
my $desc = $access