in reply to Determining the true type of a reference
sub reftype { require overload; local $_ = overload::AddrRef(shift); return /=(\w+(?:::\w+)*)\(0x[0-9a-f]\)\z/; }
I think you can put things into the package tables at runtime that won't match \w+(?:::\w+)*, but I can't imagine any sane use of that so I'd document it as a limitation and move on.
Update: substituted a star for the plus quantifier. Thanks theorbtwo.
Makeshifts last the longest.
|
|---|