user-pic

Sébastien Feugère

Subscribe to feed Recent Actions from Sébastien Feugère

  • Toby Inkster commented on Web Scraping with Zydeco

    Zydeco treats class names and role names as relative to the container package unless you prefix them with "::".

    Relevant docs.

  • Toby Inkster commented on while loops that have an index

    I'm certainly not saying each is a bad way to do things; I've just never really liked it myself. That's mostly because I don't like its behaviour with hashes though, not arrays.

    If you make changes to the hash during the loop, it can act weird. Also, the order it loops through the hash is unpredictable.

    If I'm going to loop through a hash, I generally use:

    for my $key ( sort keys %hash ) {
      my $val = $hash{$key};
      ...;
    }
    

    Though for big hashes with a lot of keys, each will perform better, so is worth consideration.

Subscribe to feed Responses to Comments from Sébastien Feugère

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl with a graphic design donated by Six Apart, Ltd.