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 ...