sub as_string { my($obj) = @_; return "$obj" unless ref $obj; my $method = overload::Method($obj, '""') or die "Give me a string, or something that pretends to be one"; # WRONG return $method->($obj); # RIGHT return $method->($obj, undef, 0); }