user-pic

smls

  • Commented on Try rakudobrew and play with concurrency
    There are cases where Rakudo/MoarVM keeps up with Perl 5 at built-ins, or beats it handily. At built-ins. Check out the benchmarks and see for yourself. I only see 3 kinds of micro-benchmarks on that page where Perl 6 comes...
  • Commented on Data::Dumper Debugging
    @Toby Inkster You're right, Data::Printer has some quirks. The prototype thing is a trade-off; it allows p to treat an array variable with a single value differently than a scalar variable, and an array differently than a hash -- with...
  • Commented on Try rakudobrew and play with concurrency
    They're finally working on making Perl 6 fast. In some examples, it's actually an order of magnitude faster than Perl 5 To be fair, I think that's only the case for micro-benchmarks that compare Perl 6 built-in features with the...
  • Commented on Data::Dumper Debugging
    Nice, although I wouldn't write use Data::Dumper; print Dumper($somevar); in the first place, I'd write: use Data::Dump; dd $somevar; or: use Data::Printer; p $somevar; ...which are not only more convenient to type, but also produce much prettier output....
  • Commented on Perl and Me, Part 8: Endless Forms Most Beautiful and Most Wonderful
    I disagree about P5 smart-matching, I think it was rightfully deprecated (i.e. an example of "self-correcting progress" rather than "progress being blocked"). The implementation tried to overload a single operator with far too many meanings, many of which where not...
  • Commented on Marpa version of Perl6 Advent Calendar, Day 18
    "Perl6's definition: ... Marpa::R2's definitions: suit ~ [♥♦♣♠] ..." I'm pretty sure the Perl 6 grammar could *also* have used a single token (with a character class) for the suits. Afaik, separating alternations into multiple tokens connected to a proto...
  • Commented on Most common build-in functions or operators beginners should know about Perl
    Note that you need to add use Scalar::Util qw(looks_like_number); to the program before being able to call looks_like_number()...
  • Commented on A Tiny Code Quiz
    He argued that even experienced developers will often get this wrong. Many Perl programmers might not guess the correct answer when presented with this "quiz". However, I believe very few would accidentally write such code in practice while ignorant of...
  • Commented on Arrow Operator Shenanigans
    chaining may be easier to read than g(f(x)). FYI, Perl6 has sequencer operators for that: source() ==> filter() ==> sink() http://perlcabal.org/syn/S03.html...
  • Commented on Perl module ideas #5
    no joy; no such ...;...
  • Commented on Why you don't need File::Slurp…
    "For small files, it's actually significantly faster" Hm... Skimming over the code of File::Slurp, it seems to use the very same technique that you present here, in the case of small files. So rob.kinyon may be right, it might just...
Subscribe to feed Recent Actions from smls

  • garu commented on Data::Dumper Debugging

    Hi everyone! I see some of the discussion got a bit sidetracked towards Data::Printer. On this matter, I just wanted to point out that I really appreciate all the enthusiasm and feedback you guys have >shown, and that because it is so hard to please everyone I've built it so you would create a ~/.dataprinter file with your own preferences and never have to worry about it again :)

    @tobyink for the issues that you have pointed out, I'd make it like so and never worry about it ever again:

      {
        use_prototypes => 0,
        return_value   => 'pass',
        deparse        => 1
       …
  • garu commented on Data::Dumper Debugging

    As for Pry, I really liked it, but like Samuel Kaufman said here, I wonder how different it is from Carp::Reply itself. You mentioned it only works when exceptions are thrown, but Carp::Reply let's you put "Carp::Reply::repl();" anywhere in the code and then resume it with Ctrl-D, just like your "pry" command does. Or did I get it wrong?

  • James commented on Data::Dumper Debugging

    Toby Inkster:
    |& is only inherited from csh, |& in ksh is for co-process creation. So the reason people don't reach for it is perhaps because it is non-standard, non-portable and incompatible. And (luckily) not every /bin/sh is a /bin/bash

  • Mike Doherty commented on Why you don't need File::Slurp…

    Would you benchmark this method of slurping, which is what I typically see?

    my $contents = do { local $/; open my $in, '<', $filename; <$in> };

    Might be worth adding to https://github.com/melo/perl-benchmarks

  • Damien "dams" Krotkine commented on Why you don't need File::Slurp&#x2026;

    I like to use this for non production code :)

    my $content = do{local(@ARGV,$/)=$filename;<>};

    I don't think it's useful to benchmark it :)

Subscribe to feed Responses to Comments from smls

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