in reply to SOLVED: CORE::stat() doesn't appear to be the same as stat

As explained by Lotus1 &stat() isn't the same thing as stat(). &stat actually is the function in the *main::stat glob, which by default does not exist:

use v5.14; use strict; use warnings; open my $fh, '>', "tmp_1222046.txt"; say 'stat($fh): ', join " ", stat($fh); say '*::stat{CODE} is ', *::stat{CODE} // 'undef'; say '$sub = \&stat;'; my $sub = \&stat; say '$sub: ', $sub; say '*::stat{CODE} is ', *::stat{CODE} // 'undef'; say 'stat($fh): ', join " ", stat($fh); say '$sub->($fh): ', join " ", $sub->($fh);
stat($fh): 0 0 33206 1 0 0 0 0 1536590875 1536590875 1536590555 *::stat{CODE} is undef $sub = \&stat; $sub: CODE(0x340be0) *::stat{CODE} is CODE(0x340be0) stat($fh): 0 0 33206 1 0 0 0 0 1536590875 1536590875 1536590555 Undefined subroutine &main::stat called line 18.
So accessing \&stat actually creates an entry in the symbols table, which is different from the function called with stat()