Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: print on reboot or process shutdown

by gaal (Parson)
on Jul 29, 2008 at 21:31 UTC ( [id://700928]=note: print w/replies, xml ) Need Help??


in reply to Re^2: print on reboot or process shutdown
in thread print on reboot or process shutdown

If you only have one normal exit point to your script, have it set a flag. Check this flag in your END block, and only write to the file when it is not set.

If you have more than one normal exit point to your script, well, refactor a bit. :-)

PS: note that the way you're opening your file, its contents will be overwritten every time, rather than appended to. Use ">>" if you prefer the other way.

  • Comment on Re^3: print on reboot or process shutdown

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-19 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found