in reply to Maintaining state in modules

You should probably use the operating system's normal per-user configuration solution because (1) you want to build on what the user already knows, and (2) you don't want one user of the module screwing up other users.

On a Windows box, the right answer is almost always the registry. Just check $^O and then eval Windows-specific versions of your history module. The registry is really easy to use with the Win32::TieRegistry module:

use Win32::TieRegistry ( Delimiter => '/' ); my $key = $Registry->{'HKEY_CURRENT_USER/Software/MyModule/History'}; my $dir = ($key ? $key->GetValue('Cwd') : 'C:/';

On a Unix box, the right answer is almost always a dot file in $HOME. Make sure the home directory is really the user's home if you execute things from your history file. (You probably want to do the same checks if you use Data::Dumper because that can eval code.)