use overload # an exception is always true bool => sub { 1 }, '""' => 'as_string', fallback => 1;