Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Strange given/when deparsing

by ikegami (Pope)
on Jun 09, 2009 at 15:53 UTC ( #769972=note: print w/replies, xml ) Need Help??


in reply to Strange given/when deparsing

Is this a bug of B::Deparse?

Yes, although it *might* have already been fixed in forthcoming 5.10.1.

You can see the difference with the more precise (but verbose) B::Concise:

g <2> smartmatch sK*/2 ->h d <0> padsv[$_:46,51] s ->e f <1> int[t4] sK/1 ->g e <0> padsv[$_:46,51] s ->f
f <2> smartmatch sK*/2 ->g d <0> padsv[$_:46,51] s ->e e <0> padsv[$_:46,51] s ->f

when(int) { say 'match' } # int($_) ~~ $x

You have the order backwards. It's $x ~~ int($_). (Well, $_ ~~ int($_) really.)

Replies are listed 'Best First'.
Re^2: Strange given/when deparsing
by akho (Hermit) on Jun 09, 2009 at 16:03 UTC
    Isn't ~~ commutative?
      It might have been. It might be. It won't be.

      Update: Is the following clearer?

      It might have been commutative in the past. It might be commutative now. It won't be commutative in the future.

        I fail to parse your answer. Maybe that's because English is not my first language.

        perlsyn says:

        It is always commutative, i.e. $a ~~ $b behaves the same as $b ~~ $a .
        Do you mean that this behavior is going to change?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://769972]
help
Chatterbox?
shmem is an "instant asshole - just add alcohol" :-P
[james28909]: you guys/gals are awesome. thanks for the wisdom.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2018-05-20 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?