Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if (undef and 1)

Status
Not open for further replies.

CherylD

Programmer
May 1, 2001
107
CA
I'm looking over a colleague's code and they start off a script with:

if (undef and 1) {

}

Does anyone have an idea about what this represents? Nothing occurs in this script before this point besides a few use statements:
use strict;
use Dargal::Web;
use File::Find;
use Data::Dumper;
 
My idea is that this translates to "if false and true".
Since false and true = false, you could get the same effect by leaving out the 1 and simply saying if (undef), or saying if (0). In other words, never execute this branch. I've sometimes written things like this (not in Perl) when I wanted to comment out a large block of code.

If the colleague who wrote the code is available, ask them what they meant. Also why they didn't just write one of the simpler expressions. I'm curious.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top