References The value returned by ref for the native Perl datatypes we have discussed already would be "SCALAR", "ARRAY", "HASH", "CODE", "GLOB" or "REF". A call to ref will return a string representing the user-defined datatype for non-native datatypes (in a minute). References are the basic building block upon which all complex datatypes are built.