[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



    Jason> Fletch wrote:
    >> Aieeeee, no.  You mean: if( ref
    >> $a_ref->{$ref}->{$ref2}->{$ref3} eq 'HASH' ) { ## Is hash ref }
    >> else { ## Not hash ref
    >> }

    Jason> Coolness.  I knew there had to be a function for that but
    Jason> couldn't find it. :D

perldoc perlreftut, perldoc perlref.


Also something someone else pointed me at out-of-band is that the
Scalar::Util module has a `reftype' function that will return the
underlying type even for blessed objects:


   reftype EXPR
       If EXPR evaluates to a reference the type of the variable refer-
       enced is returned. Otherwise "undef" is returned.

           $type = reftype "string";           # undef
           $type = reftype \$var;              # SCALAR
           $type = reftype [];                 # ARRAY

           $obj  = bless {}, "Foo";
           $type = reftype $obj;               # HASH


Granted an object would probably count as a value in the situation at
hand this wouldn't be what you'd want, but it's nice to know.

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01242" href="msg01242.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01209" href="msg01209.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01212" href="msg01212.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01213" href="msg01213.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01220" href="msg01220.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01221" href="msg01221.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01224" href="msg01224.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01227" href="msg01227.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
<li><strong><a name="01229" href="msg01229.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01235.html">[ale] Organizing data</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01237.html">[ale] Organizing data</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01229.html">[ale] Organizing data</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01242.html">[ale] Organizing data</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01236"><strong>Date</strong></a></li>
<li><a href="threads.html#01236"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>