in reply to To die or not to die
This way, if the previous config is found, it's used. Otherwise, if it's not because it's absent, we die. Simple logic.my %config; if (open FH, "user.config.file") { # we have a previous save ... get %config from FH ... close FH; } elsif ($! !~ /no such file/i) { die "config file: $!"; } ... now use %config ...
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|