in reply to Re: Getting the value of a pointer
in thread Getting the value of a pointer

Agreed.

Digression: One place where you may see explicit stringification is when using Class::DBI, where stringification produces a (numerical) primary key.

# untested my $object = Foo->retrieve(1234); # an object &function_needing_int_not_object('' . $object);

Replies are listed 'Best First'.
Re^3: Getting the value of a pointer
by ikegami (Patriarch) on Jul 18, 2005 at 19:49 UTC

    That's odd. It should overload numerification and numerical ops instead of (or in additon to) stringification.

    There is only one case where stringification is needed that comes to mind: When the function behaves differently whether a parameter is a string* or an object, and the parameter is an object with an overloaded stringification operator. For example,

    sub output { my ($fh, ...) = @_ if (!ref($fh) && ref($fh) ne 'GLOB') { open($fh, '>>', $fh); } ... }

    * or number vs object, or boolean vs object