PDA

View Full Version : Using && in perl ?


kayen85
06-19-2008, 10:14 PM
Is there any thing that could cause the && function not to work. the || function works fine as far as just about everything else I try. I am out of ideas on why the function will cause any quest not to work period.

Here is just a simple example I wrote to test it.

sub EVENT_SAY
{
if ($text=~/hail/i)
{
$JA = int 6;
$JO = int 7;
}

if {{$JO == 7}&&{$JA == 6}}
{
quest::say("Test Worked!");
}

}

Thanks

Andrew80k
06-19-2008, 10:23 PM
It should be

if (($JO==7)&&($JA==6))

You're using brackets instead of parantheses.

kayen85
06-19-2008, 10:39 PM
Wow, thank you so much. I was pulling my hair out over that. The tiny font on most websites made the () and {} look the same in all the examples.

Andrew80k
06-19-2008, 11:10 PM
hehe. Yep, I've noticed that too. Have fun.

trevius
06-20-2008, 02:42 AM
If you use Firefox, you can always hold down CTRL and use the scroll on your mouse to increase or decrease font size for any website. Comes in quite handy when you need it.

Theeper
06-20-2008, 10:06 AM
If you use Firefox, you can always hold down CTRL and use the scroll on your mouse to increase or decrease font size for any website.

This works in IE too.

Angelox
06-20-2008, 10:22 AM
This is a great Perl editor for windows
http://enginsite.com/Perl.htm
It's free, and has a registered version with more features.
Once you get the hang of it, it will show you where you screwed up with your typos (has built in Syntax Check, Expressions Tester,etc).