in reply to strange behaviour in perl ..please explain

Try it with these pragmas :

use strict; use warnings;

Update:
You may have a look at the ternary operator in perlop

my $var = 1; print ($var ? 'yes' : 'no');


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb