sub check_foo { if (exists $foo{bar}) {return $foo{bar}} else {return $the_mysterious_errorcode} }