my $foo = "test"; print +( $foo =~ /^\w+\z/ ? "condition true" : "condition false" ),$/; my $bar = defined $x ? $x : "nought"; print "\$bar is: $bar", $/; __output__ condition true $bar is: nought