sub mycheck { my ($db) = @_; $db = "" unless defined $db; # will always map undef to '' ... };