Gossamer Forum
Home : General : Perl Programming :

Conditions

Quote Reply
Conditions
I have this piece of code
if (length($rec{'fieldnname'})>7) {
print qq|<a href="$db_script_link_url&$db_key=$rec{$db_key}&show_pic=1"><img src="$slikaslika" valign="middle" border="0"></a>|;
}


But I want to include another check in the above routine so the code will be executed only if both conditions are satisfied...
something like if (lenght($rec(A)>7) and (lenght($rec(B)>3) {
}
else {
}


Tnx in advance...
Quote Reply
Re: Conditions In reply to
Try this,

Code:
if (length($rec{'fieldnname'})>7) && (lenght($rec(B)>3) {
print qq|<a href="$db_script_link_url&$db_key=$rec{$db_key}&show_pic=1"><img src="$slikaslika" valign="middle" border="0"></a>|;
}
else {
}

Hope that helps,
Chris

------------------
webmaster@racedaze.com
Quote Reply
Re: Conditions In reply to
It works great... Tnx a lot