• About: Quantum Mechanics: The dreams stuff is made of!
Subscribe to feed Recent Actions from QM

  • mascip commented on Extracting values from a list of (key, value) pairs

    Have you tried Var::Pairs, written by Damian Conway? It doesn't have a subroutine to extract all keys, but it's very god for loops:

    for my $next (pairs @array) {
    say $next->index, ' has the value ', $next->value;

  • Manuel Ceron commented on On the relative readability of Perl and Python

    I’m a Python developer but I started coding Perl full time since a little bit more than a year. It’s true that Python has many quirks. That happens with any language that is more than 20 years old. But I think Perl probably has more quirks than Python.

    I think one reason why people think that Python is more readable is because it’s simpler. Both syntax and semantics are simpler. Less operators, less constructs, less ways of doing things. In practice this means that you can understand any Python code after an afternoon. While the same thing for Perl takes years.

  • Jeremy Leader commented on I learn something about tell(), then abuse it.

    In the past, when I've been dancing along the edge between "I can do this in a line or two of shell" and "I should really switch to Perl for this", I've used "head -1" to grab the header line, and "tail -n +2" to grab the rest of the lines. Then I'd paste the headless files, and then cat together the header and the output from paste. Or maybe decide it was getting too complicated, and switch to Perl as you did!

  • James commented on I learn something about tell(), then abuse it.

    Or you could have used $fh->input_line_number() instead of $.

  • brian d foy commented on I learn something about tell(), then abuse it.

    Ah yeah, I keep forgetting to use file handles as objects. I started Perl too early to immediately jump to those.

Subscribe to feed Responses to Comments from QM

About 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 run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.