Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: why not listed foreach and if?

by LanX (Saint)
on Jul 28, 2025 at 16:50 UTC ( [id://11165839]=note: print w/replies, xml ) Need Help??


in reply to Re: why not listed foreach and if?
in thread why not listed foreach and if?

> But in Perl, we do:

> statement if (condition);

> It's weird, but one can get used to it.

I think nobody mentioned it yet in this thread, but Perl allows you to write

CONDITION and STATEMENT

and I think it's even a C'ish idiom.

EDIT

yep works in JS too

1 && console.log("yes")

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2026-02-18 06:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.