|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re: Storableby Tyke (Pilgrim) |
| on Feb 23, 2001 at 11:52 UTC ( [id://60474]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
A trick that I've found useful in TK apps is the following:
use vars qw/$CONFIG $DATA/;
BEGIN {
$CONFIG = "$0.conf";
$DATA = retrieve($CONFIG) if -e $CONFIG;
}
END {
store($DATA, $CONFIG);
}
$DATA is a reference to a hash that contains the user
entered data. This little addition to the program means
the data entered by the user in the last session becomes
the default in this session... saves a heck of a lot of
typing - particularly during testing!
In Section
Module Reviews
|
|
||||||||||||||||||||||||||||||||