Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Useless use of string in return statement

by kcott (Archbishop)
on Apr 13, 2021 at 05:50 UTC ( [id://11131168]=note: print w/replies, xml ) Need Help??


in reply to Useless use of string in return statement

G'day Bod,

When you encounter this sort of issue, you'll often find using B::Deparse, to see how Perl interprets your code, will help.

$ perl -MO=Deparse,-p -e 'return $x or $y' ((return $x) or $y); -e syntax OK $ perl -MO=Deparse,-p -e 'return $x || $y' (return ($x || $y)); -e syntax OK

— Ken

Replies are listed 'Best First'.
Re^2: Useless use of string in return statement
by Bod (Parson) on Apr 13, 2021 at 15:04 UTC

    Thanks Ken
    I've seen B::Deparse mentioned here and there and keep meaning to find out what it does and why I might want it. I guess you've just answered that for me!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-19 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found