Skip Menu |

This queue is for tickets about the Dispatch-Class CPAN distribution.

Report information
The Basics
Id: 82401
Status: rejected
Priority: 0/
Queue: Dispatch-Class

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: use if($] < 5.010), 'UNIVERSAL::DOES';
Loading UNIVERSAL::DOES on Perl < 5.010 would make behaviour more consistent across Perl versions. It's possible for Makefile.PL to add dependencies at install-time, so UNIVERSAL::DOES need not be added as a dependency for newer versions of Perl. http://search.cpan.org/~dagolden/CPAN-Meta-2.120921/lib/CPAN/Meta/ Spec.pm#dynamic_config
On Fri Jan 04 07:01:03 2013, TOBYINK wrote: Show quoted text
> Loading UNIVERSAL::DOES on Perl < 5.010 would make behaviour more > consistent across Perl versions.
How would it make behavior more consistent? Dispatch::Class doesn't use UNIVERSAL::DOES() (at least not directly). Dispatch::Class checks whether the exception object ->can('DOES'). This check succeeds if - you're running a modern perl where UNIVERSAL::DOES exists by default - you're running an old perl and someone has loaded UNIVERSAL::DOES (the module), which defines UNIVERSAL::DOES (the sub) - you're running an old perl and the exception object composes some roles, in which case it will have a custom DOES method anyway So the check only fails if - you're running an old perl, no one has defined UNIVERSAL::DOES() manually, and the exception object doesn't use roles ... in which case Dispatch::Class falls back to ->isa(), which is what UNIVERSAL::DOES would have done anyway. This is why I don't think loading UNIVERSAL::DOES would make a difference. (I'm going to close this bug. Please re-open it if I've overlooked anything in my analysis above!)