On Fri, 2006-02-06 at 13:25 -0400, Ryan Frantz wrote:
> If I create a reference, can I determine if it's an
> arrayref of hashref?
if( ref( $ref ) eq 'HASH' ){
print "It's a hash\n";
}elsif( ref( $ref ) eq 'ARRAY' ){
print "It's an array\n";
}elsif( ref( $ref ) eq 'SUB' ){
print "It's a sub\n";
}elsif( ref( $ref ) ){
print "It's a typeglob or object reference\n";
}
# See `perldoc -f ref` for details.
--
__END__
Just my 0.00000002 million dollars worth,
--- Shawn
"For the things we have to learn before we can do them, we learn by doing them."
Aristotle
* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>