Usage of ref for testing if a passed in reference is a HASH, etc

[prev] [thread] [next] [Date index for 2004/11/12]

From: Michael Henson
Subject: Usage of ref for testing if a passed in reference is a HASH, etc
Date: 18:51 on 12 Nov 2004
Many places in Class::DBI use ref to determine if a given value is a
reference to an array or a hash. Wouldn't it be better to use
UNIVERSAL::isa, esp if the only purpose is to make sure that accessing a
key makes sense?

This comes in handy, especially when you are passing around objects who
are simply hash-refs blessed into a class and wish to create Class::DBI
objects based on them. (SOAP::Lite for instance will do this)

        -- 
        Michael Henson <michael@xxxxxx.xxx>

Usage of ref for testing if a passed in reference is a HASH, etc
Michael Henson 18:51 on 12 Nov 2004

Generated at 17:31 on 15 Feb 2005 by mariachi v0.52