|P is for Practical|
why "link", "rename", but no "unlink" in CORE::?by perl-diddler (Hermit)
|on Feb 26, 2013 at 16:58 UTC||Need Help??|
perl-diddler has asked for the
wisdom of the Perl Monks concerning the following question:
I was putting an error message wrapper around some file operations like rename and link to get the error handling 'out of band' -- not have it inline w/the code so it obscured the flow of the code. Created a small wrapper:
Went to do the same with "unlink":
But had this coming out from perl:
&CORE::unlink cannot be called directly at <file> line <#>
Note, I had earlier, tried making such calls without the "CORE::" in front of them, but got errors about no such local routines being defined...so thought 'CORE::' was the way to go for perl built-ins...
Why the exceptions?... and do I just have to special case all the ones that give errors as they come up?
I didn't get from my last read of the docs that "unlink" was somehow radically different from "link"... Ideas?