in reply to A Perl aptitude test
I'm not sure how to answer this, because I find it difficult to imagine describing someone who got 3, 5, 6 or 7 wrong as a "fairly decent" perl programmer. 2 and 4 are more difficult, particularly since the candidate needs to guess how much they should say - I'm sure you could write for an hour on either one without exhausting the subject.
But they all seem reasonable questions; 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. Perhaps more reasonable would be to say something like:
1. This code prints "5". Why is the "+" sign necessary?
print +(2 * 3) - 1;
Because of their open-ended nature, I'd also be inclined to put 2 and 4 last, and perhaps keep just one of them: they feel more like "extra credit" questions.