La función reftype de Scalar::Util
funciona de manera parecida a ref EXPR
, con la diferencia
de que sobre los objetos no retorna la clase del objeto:
$type = reftype "string"; # undef
$type = reftype \$var; # SCALAR
$type = reftype []; # ARRAY
$obj = bless {}, "Foo";
$type = reftype $obj; # HASH
Casiano Rodríguez León

Principios de Programación Imperativa, Funcional y Orientada a Objetos Una Introducción en Perl/Una Introducción a Perl
por Casiano Rodríguez León
is licensed under a Creative Commons Reconocimiento 3.0 Unported License.
Permissions beyond the scope of this license may be available at http://campusvirtual.ull.es/ocw/course/view.php?id=43.
2012-06-19