http://www.perlmonks.org?node_id=255188


in reply to Re: A Perl aptitude test
in thread A Perl aptitude test

the only one I think is a bit unreasonable is #1, because it is code you wouldn't normally ever expect to write except in error.

I think the problem with the question is that the parens are there only to be "tricky". The error would be more understandable if the parenthesized operation was of lower precedence.

So I'd have posed the question like this:

  1. The following line of code is an example of a common coding error in Perl:
    print (2 + 3) * 4;
    1. What does the statement print?
    2. Why?
    3. How could you fix it?