Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Perl Code Changes Behavior if Two Subroutine definitions are swapped

by Athanasius (Archbishop)
on Jul 28, 2016 at 09:57 UTC ( [id://1168712]=note: print w/replies, xml ) Need Help??


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
    Isnt switch noncore? I doubt perl version plays any part, aside from deparse version

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1168712]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found