The following works for me:

----------snip-------------
#!/usr/bin/perl -w
use strict;

my $winner = 1;
if ($winner == 1) {
    print "$winner\n";
}
----------snip-------------

The above yeilds: 1

If you wanted to print "winner", then remove the '$' from the "print" 
statement ;-). Oh Yeah! ...make sure your code is executable (chmod +x 
<filename>).

Ron

>From: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: If Statement won't work
>Date: Thu, 2 Aug 2001 11:22:25 -0500
>
>Can anyone tell me why my if statement refuses to work?  It is really 
>simple.  I can't understand it.
>
>$winner = 1;
>if($winner == 1){
>print "$winner\n";
>}
>
>No matter what I try, it never returns true.  Not even 1 == 1.
>
>Any ideas?
>
>Chris
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to