in reply to Re^8: Passing argument by reference (for a scalar)(Unary Plus)
in thread Passing argument by reference (for a scalar)

Which, in turn, sometimes needs another similar trick:
my %hash = map { "a$_" => undef } @list; # syntax error at ... line +1, near "} @list" my %hash = map {; "a$_" => undef } @list; # OK.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^10: Passing argument by reference (for a scalar)(Unary Plus)
by LanX (Saint) on Sep 11, 2024 at 15:13 UTC
    Granted, in this case you are right. ++

    And I hate this ambiguity, because the parser can't defer parsing the inside of the block till it sees if a comma is following or not

    • } , @list is hash
    • }   @list is block

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery