Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Bug in eval in pre-5.28

by haukex (Archbishop)
on Apr 07, 2021 at 11:51 UTC ( [id://11130946]=note: print w/replies, xml ) Need Help??


in reply to Bug in eval in pre-5.14

On pre-5.14 Perls, this is a bug.

I just wanted to mention that some of the known remaining bugs (1, 2, 3) weren't fixed until v5.28. Basically, at this point, I would never recommend eval { ... }; if ($@) { ... }.

my $success = eval { ...; 1 }; is The Right Way To Do It.* And remember that $@ could still be a false value.

* TIMTOWTDI still applies: eval { ...; 1 } or do { ... };, unless ( eval { ...; 1 } ) { ... }, my $ok = eval { ...; 1 }; if (!$ok) { ... }, and so on.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found