in reply to Re^4: RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)
in thread RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)
I guess what you're saying here is that the low-level routines that detect the errors, only set the numeric part of $!, and that the text part is derived (looked-up) from that when asked, at which point the filename used in the failing system request is no longer available.
But when a warn or die is called, it is able to tell us the line number of the last file read, and this is considered useful enough information to be added by default. A similar mechanism--presumably a global variabe ($.)--could be used to remember the pathname provided to the last open attempt, and used to provide that information when $! is interpolated.