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

autodie both adds the file name to the error message and saves you from having to do the or die ...; dance:
# open.pl use strict; use warnings; use autodie; open HIGHLANDER, ">>/root/renew.cgi.highlander";
when run (as non a root user), gives:
+% perl open.pl Can't open '>>/root/renew.cgi.highlander' for appending: 'Permission d +enied' at open.pl line 6 +%
  • Comment on Re^3: RFC: A new module to help avoid running multiple instances of the same script (via cron, for example)
  • Select or Download Code