On Thu, 16 Oct 2008 14:24:56 +0530, sanket vaidya wrote:
> use warnings; 
> use strict;

Good!  use warnings has shown you a bug in your code.

> my $string = "test";
> 
> $string eq "test" ? print "correct" : "";
> 
> 
> Output:
> 
> Correct
> 
> Useless use of constant in void context at line 5.

Your program says that if $string eq "test" then execute:

        print "correct"

otherwise execute:

        ""

That's a (constant) string in void context.  You meant:

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

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/


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


Reply via email to