There's more than one way to do things | |
PerlMonks |
Re^3: Perl Code Changes Behavior if Two Subroutine definitions are swappedby Athanasius (Archbishop) |
on Jul 28, 2016 at 09:57 UTC ( [id://1168712]=note: print w/replies, xml ) | Need Help?? |
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:
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,
In Section
Seekers of Perl Wisdom
|
|