Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: why does Perl eval have a strange terminator?

by LanX (Saint)
on Jun 14, 2022 at 21:56 UTC ( [id://11144743]=note: print w/replies, xml ) Need Help??


in reply to Re^2: why does Perl eval have a strange terminator?
in thread why does Perl eval have a strange terminator?

I think I'm beginning to understand where you're coming from.

Try/Catch in other languages is a compound statement, and the new Perl feature is also implemented as such.

But

  • eval {BLOCK};

isn't, it's function like.

I think that's at least partly due to sharing its name with

  • eval "string";

in Perl.

Actually it's quite surprising for many coming from other languages, that we call it "eval".

Larry often loved to "recycle" concepts.

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

Replies are listed 'Best First'.
Re^4: why does Perl eval have a strange terminator?
by ikegami (Patriarch) on Jun 27, 2022 at 13:29 UTC

    I think that's at least partly due to sharing its name with eval "string";

    It's due to it returning a value. That makes it an expression.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-24 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found