# Unique catcher for a missing argument use constant MISSING => bless {}, __PACKAGE__ . '::__missing__'; # Helper sub, that either checks its argument against the catcher # or otherwise returns the catcher itself. sub missing { @_ ? $_[0] && $_[0] eq MISSING : MISSING; } # To be used with signatures in various places: sub foo ($self, $val=missing) { if (missing $val) { # getter } else { # setter } }