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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie: failing IF statement

Status
Not open for further replies.

AlbertAguirre

Programmer
Nov 21, 2001
273
0
0
US
Why does this fail???

$setType="raise";
if ($setType=="lower"){
print "in if \n";
}else{
print "in else \n";
}

The output is consitantly:

in if

Why???
 
OK. after hours of searching i found the "eq"

This works.

$setType="raise";
if ($setType eq "lower"){
print "in if \n";
}else{
print "in else \n";
}

in else


Sorry to trouble you!
 
hours of searching? Dang.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top