--- On Thu, 10/16/08, sanket vaidya <[EMAIL PROTECTED]> wrote:

> From: sanket vaidya <[EMAIL PROTECTED]>
> Subject: if condition question
> To: beginners@perl.org
> Date: Thursday, October 16, 2008, 4:54 AM
> Hi all,
> 
>  
> 
> Kindly go through the below codes:
> 
>  
> 
> use warnings;
> 
> use strict;
> 
> my $string = "test";
> 
> if ($string eq "test")
> 
> {
> 
> print "correct";
> 
> }
> 
>  
> 
> Output:
> 
> Correct
> 
>  
> 
> Now when I write the same if condition in program as below,
> I get warning
> along with output.
> 
>  
> 
> use warnings;
> 
> use strict;
> 
> my $string = "test";
> 
> $string eq "test" ? print "correct" :

the above should be:

print $string eq "test" ? "correct" : "others";


Jeff.


      


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to