develooper Front page | perl.beginners | Postings from April 2010

Re: Is this a feature or a bug?

Thread Previous | Thread Next
From:
marcos rebelo
Date:
April 29, 2010 12:34
Subject:
Re: Is this a feature or a bug?
Message ID:
i2v319d96981004291234z6f925bf7x51f67e368797a7ac@mail.gmail.com
With all this solutions, seems that I may use:

'our $_' or '$::_'

But it is really crazy in designers of perl to make this.

If this isn't a major bug, Damian needs to write some new rule in is book.

Best Regards
Marcos Rebelo

On Thu, Apr 29, 2010 at 5:56 PM, marcos rebelo <oleber@gmail.com> wrote:
> the code:
>
> use v5.10;
> use Modern::Perl;
> use List::MoreUtils qw(any);
>
> say( (any { $_ eq 7 } (0..10) ) or 'false' );
>
> given (5) {
>    when (5) {
>        say( (any { $_ eq 7 } (0..10) ) or 'false' );
>        say( join(", ", map { $_ eq 7 } (0..10) ) );
>    }
> }
>
>
> prints:
>
> 1
> false
> , , , , , , , 1, , ,
>
>
>
> the second 'any' should have returned a true value or not, and why???
>
>
> Best Regards
> Marcos Rebelo
>
> --
> Marcos Rebelo
> http://oleber.freehostia.com
> Milan Perl Mongers leader http://milan.pm.org
>



-- 
Marcos Rebelo
http://oleber.freehostia.com
Milan Perl Mongers leader http://milan.pm.org

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