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

Welcome back Bloodnok.

I noticed a couple of things in the CORE documentation:

Calling with ampersand syntax and through references does not work for the following functions, as they have special syntax that cannot always be translated into a simple list (e.g., eof vs eof()):

chdir, chomp, chop, defined, delete, eof, exec, exists, lstat, split, stat, system, truncate, unlink

I'm still learning about this but my understanding is that you can override things in Perl but calling the CORE version is always the CORE version. So the function is a reference that starts off pointing to the CORE version. You can change glob() for example but CORE::glob won't change. This means that glob() is a different reference that starts out pointing to CORE::glob. References to them will always be different even when they are pointing to the same code since glob() refers to CORE::glob().

Edit: The second thing I noticed was this in the documentation:

For all Perl keywords, a CORE:: prefix will force the built-in function to be used, even if it has been overridden or would normally require the feature pragma. Despite appearances, this has nothing to do with the CORE package, but is part of Perl's syntax.

I'm not sure if this supports or contradicts my understanding.

  • Comment on Re: CORE::stat() doesn't appear to be the same as stat