Hacker News new | past | comments | ask | show | jobs | submit login

Oh I was sure the syntax was ok in both forms. I'm guessing it's a GLR revision. It's indeed better to to reserve {} for scalar containers.

Notice how in Perl 6 you get a nice error message:

    $ perl6 -e 'my %h = { foo => "bar" };'
    Potential difficulties:
        Useless use of hash composer on right side of hash assignment;
        did you mean := instead?
        at -e:1
        ------> my %h = { foo => "bar" }⏏;



That's good, because in Perl 5, it does DWIM, but that sometimes means returning undef, which - erm, thanks Perl ;)




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: