Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re^3: Indirect Object Syntax

by choroba (Archbishop)
on Nov 07, 2021 at 21:50 UTC ( #11138559=note: print w/replies, xml ) Need Help??

in reply to Re^2: Indirect Object Syntax
in thread Indirect Object Syntax

> Anyway, Perl should check for the missing comma. I suppose this happens too late for the parser.

IIRC, the parser can only check the following token when deciding whether the { starts a block or an anonymous hash. That's also why the ; helps.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^4: Indirect Object Syntax
by LanX (Sage) on Nov 08, 2021 at 00:00 UTC
    yeah, that's what I meant with

    > I suppose this° happens too late for the parser.

    °) i.e. the comma


    Anyway: any correctly parsed LIST inside an {anonymous hash} is also a legal block (just the LIST returned)

    Perl could always try to parse a block and look if there is a comma following.

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

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11138559]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2022-05-26 01:44 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (92 votes). Check out past polls.