user-pic

Damian Conway

Subscribe to feed Recent Actions from Damian Conway

  • Timm Murray commented on Do not use each

    I've also seen situations where each was called in a loop that short-circuits:

    while( my ($key, $val) = each %hash ) {
        last if $key =~ /foo/;
    }
    

    Then later on, each is used again without resetting the internal state, even though the programmer expected to iterate over the entire hash. With a hash stored globally (yes, this is bad in itself, but it happens) in a persistent environment like mod_perl, this can even happen across different requests in the same process.

  • Tim Bunce commented on Do not use each

    I wonder if there's some way to make the each op warn if the iterator isn't where it's expected to be.

  • E. Choroba commented on Do not use each

    Unfortunately, glob is similarly broken:


    perl -E 'for my $x (qw(* )) { print "$x: ", scalar glob($x), "\n"}'

  • E. Choroba commented on Do not use each

    Sorry, should have been:

    perl -E 'for my $x (qw(* < >)) { print "$x: ", scalar glob($x), "\n"}'

  • Yuki Kimoto commented on How about separating dynamic world and static world?

    Damian Conway

    Thanks for your comment.

    But the multi keyword doesn't provide static function overloading. The multi keyword provides dynamic multiple dispatch.

    I think is is not good because performance cost occur when type check is done at run-time,
    and it increase launguage complexity.
    Perl has already complex syntax. I don't hope more complexity.

    For example, I like cpan-minus than cpan-plus. why? cpan-minus is fast, minimal and enough.
    I like small aproach which can solve problems smart.

    For the long time, Perl…

Subscribe to feed Responses to Comments from Damian Conway

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is hosted by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.