use constant CHOICE_LIST => 'l'; my $db_file = 'birthday.db'; # ... later ... if ($choice eq CHOICE_LIST) { open(IN, $db_file) || die "Cannot read '$db_file': $!\n"; print ; close IN; }