Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Pattern matching in perl [short-circuit and declared vs. defined]

by kcott (Archbishop)
on Jun 30, 2022 at 18:30 UTC ( [id://11145206]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -E 'my $pattern; say +(defined($pattern)) ? "YES" : "NO"'
    NO
    ...
    
    $ perl -E 'my $true = 1; my $pattern; say +(defined($pattern) || $true
    +) ? "YES" : "NO"'
    YES
    

Log In?
Username:
Password:

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

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

    No recent polls found