M
Michael Goerz
Hi,
is there a way to find out the type of the datastructure a reference is
pointing to? Suppose I have an array of references and basic types like
this:
@testarray = (
["bla", "xyz"],
{"key" => "value"},
\$var,
"blabla",
123 );
Could I write some function 'typeOfElem', so that
typeOfElem($testarray[0]); prints "reference to array",
typeOfElem($testarray[1]); prints "reference to hash"
typeOfElem($testarray[2]); prints "reference to scalar"
typeOfElem($testarray[3]); prints "scalar"
typeOfElem($testarray[4]); prints "scalar"
Thanks,
Michael Goerz
is there a way to find out the type of the datastructure a reference is
pointing to? Suppose I have an array of references and basic types like
this:
@testarray = (
["bla", "xyz"],
{"key" => "value"},
\$var,
"blabla",
123 );
Could I write some function 'typeOfElem', so that
typeOfElem($testarray[0]); prints "reference to array",
typeOfElem($testarray[1]); prints "reference to hash"
typeOfElem($testarray[2]); prints "reference to scalar"
typeOfElem($testarray[3]); prints "scalar"
typeOfElem($testarray[4]); prints "scalar"
Thanks,
Michael Goerz