-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
u$a and $b not set properly when calling a sort comparator in another package #14028
Comments
From @mjdominusCreated by @mjdominuspackage A; sub scmp { print "$a $b\n"; return $a <=> $b } package B; @b = sort A::scmp reverse(1..4); The $a and $b values are not properly passed to A::scmp. Instead the The sort operator could handle this properly, because it knows (or Moreover, this deficiency isn't documented, although it seems to be hinted at by the sub backwards ($$) { $_[1] cmp $_[0]; } example. Perl Info
|
From @iabynOn Fri, Aug 15, 2014 at 04:35:15PM -0700, Mark-Jason Dominus wrote:
I think that might open a can of inconsistent worms. For example, package A; or potentially package A; -- |
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiOn Mon, Aug 18, 2014 at 6:27 AM, Dave Mitchell <davem@iabyn.com> wrote:
Easy: A, as scmp reads $A::a and $A::b. This information is readily available. $ perl -MDevel::Peek -e'package A; *B::scmp = sub {...}; package C; |
From @iabynOn Mon, Aug 18, 2014 at 06:30:36PM -0400, Eric Brine wrote:
Except that it isn't for the second example I gave: $ p -MDevel::Peek -e'package A; *B::scmp = sub {...}; package C; delete $::{"A::"}; Devel::Peek::Dump(\&B::scmp);' which is what I meant about a can of inconsistent worms; i.e. it will -- |
From @ikegamiOn Mon, Aug 18, 2014 at 7:42 PM, Dave Mitchell <davem@iabyn.com> wrote:
oops, I must have botched my test. which is what I meant about a can of inconsistent worms; i.e. it will
How often do people delete packages? It's rather common to delete from |
Migrated from rt.perl.org#122545 (status was 'open')
Searchable as RT122545$
The text was updated successfully, but these errors were encountered: