May I suggest that you call Storable::store() in your:
# some code here
processing on a regular basis? The problem with calling store() at random points is that the data structure you want to save may be in an inconsistent state. Storable::store is very efficient and so it is not a problem to call it frequently whenever you have made a consistent set of modifications to your data, perhaps, for example, at the end of your while loop. This would eliminate the need to catch the Ctrl-C in your code and so make your script simpler and more reliable.
In reply to Re: Handle Ctrl-C on Windows
by philiprbrenan
in thread Handle Ctrl-C on Windows
by cztmonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |