evalEmpire / perl5i

A single module to fix as much of Perl 5 as possible in one go
http://search.cpan.org/perldoc?perl5i
Other
156 stars 42 forks source link

UNIVERSAL::ref #233

Open daxim opened 11 years ago

daxim commented 11 years ago

In http://www.modernperlbooks.com/mt/2009/07/fearpm.html, chromatic uses UNIVERSAL::ref in his boilerplate code. Figure out what this is good for and whether perl5i wants it.

schwern commented 11 years ago

Anywhere you call ref($obj) on a Pirate object, it will allow Pirate to lie and pretend to be something else.

Why do we want that?

schwern commented 11 years ago

Giving it another week for discussion to emerge now that its properly labeled. If there's no discussion by then, it can be closed.

notbenh commented 11 years ago

Possibly @chromatic wants to chime in and give examples but I am not thinking of any cases where I would expect this in core. And the cases that I am thinking about where this ~could~ be used, would already be addressed by other perl5i-isms.

chromatic commented 11 years ago

The useful case for me is where someone uses ref() instead of isa() or DOES(), but that's in the bucket of "How do you want to work around broken code?" and not the bucket of "How can I do more awesome things?"

notbenh commented 11 years ago

Thanks for the comments @chromatic, do you feel that if we abstracted away the details for figuring out a 'what is this thing' that it would still be useful? See #42 for a few ideas of what we were thinking.