Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Compile the source, Luke (Re: Statement Modifiers, Whaa?)

by cmilfo (Hermit)
on May 10, 2002 at 03:53 UTC ( [id://165592]=note: print w/replies, xml ) Need Help??


in reply to Re: Statement Modifiers, Whaa?
in thread Statement Modifiers, Whaa?

This is where the Perl compiler becomes your best friend. If you run perl -MO=Deparse,-p [your script name here], the presedence Perl sees will be printed out. See below for your code example from above, which I stored in hello.pl.
[cmilfo@cmilfo monks]$ perl -MO=Deparse,-p hello.pl ($nice = 0); sub hello1 { (($nice or return('Hi')) or return('Get Lost!')); } sub hello2 { (((!$nice) || return('Hi')) and return('Get Lost!')); } print(hello1(), hello2()); hello.pl syntax OK
It basically puts in all the () and {} that we may not see.

Cheers!
Casey

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-20 04:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found