Re: code line of the day

Bart Lateur <[email protected]> Wed, 13 Sep 2006 22:18:07 +0200
Newsgroups gmane.comp.lang.perl.fun
Organization Me, Myself and I
Message-ID <[email protected]>
On Fri, 8 Sep 2006 08:19:21 -0700 (PDT), John Douglas Porter wrote:

>If you really want to test the ref type, do so
>robustly using the methods in Scalar::Util.

I'm not convinced that is indeed the best  approach. So Uri expects
either a plain string, or a scalar ref to a string.

What if instead you get an object? Do you want to treat it as a scalar
ref, or as a plain string? IMO you *don't* want to peer inside the
intestines of an object, instead, you ought to treat the object as a
black box, *not* look at what kind of blessed ref it is, and thus, you
should be wanting to use the stringified object.

Thus: treat only an unblessed scalar ref as a scalar ref.

-- 
	Bart.