user-pic

Max Maischein

  • Website: corion.net
  • About: I'm the Treasurer for the Frankfurt Perlmongers e.V. . I have organized Perl events including 7 German Perl Workshops one YAPC::Europe.
Subscribe to feed Recent Actions from Max Maischein

  • Jon Jensen commented on Are Restricted/Locked Hashes A Failed Experiment?

    I've used restricted hashes in a few ecommerce situations where they were indispensable, exactly as important and useful as `use strict` for making sure lexical accesses aren't typos.

    I don't have any opinion about whether restricted hashes should be part of all hash types -- I think I'd be fine using a special hashlike object since I haven't used them a lot. But in the cases I've needed them, they were really, really helpful.

  • Andreas Koenig commented on Are Restricted/Locked Hashes A Failed Experiment?

    kid51: short example

    % perl -le '
    use Getopt::Long;
    use Hash::Util qw(lock_keys);
    lock_keys %Opt, qw(mrg);
    GetOptions(\%Opt, "mrg=i") or die;
    if ($Opt{mgr}){
    print "INT=$Opt{mrg}";
    }
    '
    Attempt to access disallowed key 'mgr' in a restricted hash at -e line 6.

    An example that combines with Pod::Usage:
    http://repo.or.cz/cpan-testers-parsereport.git/blob/HEAD:/bin/ctgetreports

  • Mikko Koivunalho commented on Are Restricted/Locked Hashes A Failed Experiment?

    For me lock_keys is a typo checker, also but not limited for production code, also but not limited for blessed hashed.

  • Toby Inkster commented on Are Restricted/Locked Hashes A Failed Experiment?

    Locked hashes are great, but if the implementation is slowing down all hashes, then I agree they should no longer be built in, and should be moved to a module

    That said, I think it's an important enough feature that this module should be bundled with Perl, so that people relying on fields.pm (which was first released with Perl 5.5) and Hash::Util (Perl 5.8) won't need to install anything extra.

  • Alceu Rodrigues de Freitas Junior commented on Are Restricted/Locked Hashes A Failed Experiment?

    I have used Hash::Utils more than once, specially in OOP projects that I was using "default" OOP model of Perl (not Moose or anything like that).
    On the other hand, I usually don't start using it from scratch, usually when things starts to getting more complex and bugs starts to appear it is a sign that I should consider using it.
    It is good to be have options... sometimes you need flexibility (like expanding a…

Subscribe to feed Responses to Comments from Max Maischein

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.