Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)

by djp (Hermit)
on Dec 06, 2009 at 11:14 UTC ( [id://811323]=note: print w/replies, xml ) Need Help??


in reply to Re^3: 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)

How could that be done? $! is associated with errno or equivalent, but not necessarily with a file.
  • Comment on Re^4: RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)

Replies are listed 'Best First'.
Re^5: RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)
by BrowserUk (Patriarch) on Dec 06, 2009 at 11:55 UTC

    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.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://811323]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-19 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found