develooper Front page | perl.perl5.porters | Postings from February 2008

Re: Clarifying smart match behaviour in when( ... && ... )

Thread Previous | Thread Next
From:
Joshua ben Jore
Date:
February 18, 2008 12:58
Subject:
Re: Clarifying smart match behaviour in when( ... && ... )
Message ID:
dc5c751d0802181258g6c67410fr42ae86c19571df7e@mail.gmail.com
On Jan 29, 2008 7:20 PM, brian d foy <brian.d.foy@gmail.com> wrote:
> #!/usr/local/bin/perl5.10.0

I responded to your use.perl post but here's it for p5p too. You are
experiencing a bug. I doubt the implementation is what anyone
intended. Here's what's actually happening:

given( 'Barney' ) { when( @n and %n ) }
=> ( scalar( @n ) and scalar( %n ) ) ~~ 'Barney'
=> ( 3 and '2/8' ) ~~ 'Barney'
=> '2/8' ~~ 'Barney'
=> '2/8' eq 'Barney'
=> false

Josh

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About