in reply to strange behaviour in perl ..please explain
Try it with these pragmas :
use strict; use warnings; [download]
Update: You may have a look at the ternary operator in perlop
my $var = 1; print ($var ? 'yes' : 'no'); [download]
hth,PooLpi