user-pic

Sébastien Feugère

  • Website: hi.balik.network
  • About:

    I am a Perl culture enthusiast since 2011.

    Currently working at a french opinion institute, I try to build tools using the Perl toolkit, but also Debian, LXC and a bit of JavaScript.

    Other hobbies:

    Go to my Gitlab account to discover more.

  • Posted Load a list of lines into an array (easily) to Smonff

    This blog post describes a common task my colleagues ask often about repeating a dynamic string in a defined token and adding some or, and, = in between, plus finishing smartly.

    I like to use…

  • Commented on while loops that have an index
    I guess the aim of this post was more like a way to show an exotic thing (a while with an index) that exist in Perl than showing something that should be done: dunno, the syntax is quite messy, but,...
  • Commented on while loops that have an index
    This is More Neat Ways To Do It !...
  • Commented on while loops that have an index
    I am not that used to the $#array syntax (I knew it before but totally forgot). It seems overally more readable and concise. By the way, I know that the perldoc itself recommend not to use what I presented but,...
  • Posted while loops that have an index to Smonff

    Perl got this syntax that allow to use a while loop without having to explicitly increment an index by doing an i++. It is made possible by the each function.

    Let's demonstrate…

  • Commented on Web Scraping with Zydeco
    Thanks for sharing this: it helps to have a real life example that go beyond the Foo::Bar app....
  • Commented on Web Scraping with Zydeco
    Zydeco prefixes your class names with the package name. The :: in front of class names will avoid this.> This is explained with an example in this documentation....
  • Posted A concise mtime sorted directory listing application to Smonff

    Today we will focus on a simple task: listing the files contained in a directory, sort them by modification time (see mtime) and display the result in a JSON array.

    We are gonna…

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.