print (1 ? 1 : 0) . 'x'

David Dorward david at dorward.me.uk
Thu May 11 11:07:01 BST 2006


On Thu, May 11, 2006 at 10:59:01AM +0100, O'Shaughnessy, Jamie wrote:
> 
> print (1 ? 1 : 0) . 'x';
> 
> What do you expect this would print?

1

Since it is the same as:
print( (1 ? 1 : 0) ) . 'x';

Using warnings would have told you that print (...) was "interpreted
as function" and complain about "Useless use of concatenation (.) or
string in void context".

-- 
David Dorward                                      http://dorward.me.uk



More information about the london.pm mailing list