Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Anyone use "xor" in conditionals?

by BUU (Prior)
on Jul 14, 2003 at 23:29 UTC ( [id://274224]=note: print w/replies, xml ) Need Help??


in reply to Re: Anyone use "xor" in conditionals?
in thread Anyone use "xor" in conditionals?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Anyone use "xor" in conditionals?
by Abigail-II (Bishop) on Jul 14, 2003 at 23:45 UTC
    $ perl -we"print 'omg' if -d 'bcc' == -d 'cygwin'" Use of uninitialized value in numeric eq (==) at -e line 1. Use of uninitialized value in numeric eq (==) at -e line 1. omg$ ls bcc cygwin ls: bcc: No such file or directory ls: cygwin: No such file or directory $

    Abigail

Re: Re: Re: Anyone use "xor" in conditionals?
by jsprat (Curate) on Jul 14, 2003 at 23:41 UTC
    Try it with a non-existent directory. Perl will warn if you do a numeric comparison with an undefined expression, while undef will evaluate as false in a boolean comparison.

    HTH

    PS Change the 'if' in your original node to 'unless', but I'm guessing you already know that...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://274224]
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: (4)
As of 2024-04-23 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found