Hello Ricardo,
Show quoted text > On 2013-02-01 10:41:08, CORION wrote:
>> I already wrote to David Golden in a related mail that I'm opposed to
>> this change. I don't see any big gain over the two-line approach of
>>
>> use 'Some::Parent' 1.23;
>> use parent 'Some::Parent';
>
> Isn't this like "I don't see any big gain of use parent over; use SomeParent 1.23; BEGIN { push
> our @ISA, 'SomeParent' }" ?
Yep, it's just shorter to type, and the version number is a use case
that I find rare.
Show quoted text>> I especially want to avoid one of the really ugly problems of base.pm,
>> which forced a version number for modules that didn't provide a
>> version
>> number themselves ("-1, set by base.pm").
>
> Nobody is suggesting restoring such nonsense! Certainly not me, and if David Golden is
> going to argue for anything, I'm sure it wouldn't be this. ;)
>
>> local *CORE::GLOBAL::caller = sub { $inheritor };
>> ...
>
>> To get around the nasty *CORE::GLOBAL::caller thing, which depends on
>> the load order of parent.pm, I can think of moving the main code of
>> parent.pm to a subroutine that takes the target namespace as an
>> argument instead of inferring it from caller(0).
>
> This seems like contortions in service of conceptual purity that doesn't have much practicla
> value.
I see an easy way to add this feature outside of parent.pm by doing a
small, non-invasive change to parent.pm itself, which allows it to be
used from other modules in an easy way. Which is why I proposed this
change, so the intended functionality can be added in a separate module
without changing the existing API and parameter convention of parent.pm.
Especially in the light of three different approaches, DWIM at the cost
of disallowing numeric package names, and explicit, using hashrefs or
arrayrefs, I think that the best API for passing a version requirement
isn't obvious, and trying out the alternatives is better done outside
parent.pm.
-max