in reply to Re: Optional quotes: to use or not to
in thread Optional quotes: to use or not to

Then don't use curlies!

$ perl6 -e'my %h = foo => 1; %h.perl.say' {:foo(1)}<> $ perl6 -e'my %h; %h<foo> = 1; %h.perl.say' {:foo(1)}<>

FWIW I do not use quotes whenever possible.

When I use quotes, I use double quotes. always.

I put all keys of a hash inside quotes in an initialization when any of the keys need quotation, for consistency and visual appealing.


Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^4: Optional quotes: to use or not to
by QM (Parson) on Jul 10, 2015 at 13:52 UTC
    IIRC, curlies are necessary for anonymous hash constructions.

    Single quotes are quite useful, reducing backwhacks, such as:

    print 'The value of $scalar is ', $scalar, ', and this line ends with +\n', "\n";

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of

      I still much prefer:

      print "The value of \$scalar is $scalar, and this line ends with \\n\n +"; say "The value of \$scalar is $scalar, and this line ends with \\n";

      Enjoy, Have FUN! H.Merijn