in reply to Re^2: Perl Code Changes Behavior if Two Subroutine definitions are swapped
in thread Perl Code Changes Behavior if Two Subroutine definitions are swapped
I tried running your example code using perl 5.10.1 and got following output...
Interesting. Experimenting with the Strawberry Perl versions I have on my system, it appears the change occurred between Perl 5.12.3 and 5.14.4. Running with -MO=Deparse reveals only one difference:
&Switch::switch(); # v5.12.3 vs. &Switch::switch(()); # v5.14.4
And calling switch explicitly with an empty list — switch(()) — under 5.12.3 gives the same result as calling switch() under 5.14.4.
I’ve skimmed through the deltas, but so far haven’t found a plausible explanation. Possibly related to the change in handling the (;$) prototype,1 since that is the prototype of sub switch in the Switch module, but I don’t see how that would account for the observed behaviour. :-/
1See “Change in parsing of certain prototypes” in perl5140delta.
Cheers,
Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Perl Code Changes Behavior if Two Subroutine definitions are swapped
by Anonymous Monk on Jul 28, 2016 at 10:22 UTC |