Sample answers to Christmas Quiz
simon at simon-cozens.org
Fri Dec 19 08:52:44 GMT 2008
David Alban wrote:
>> 4) How many different variable types are there in Perl? Be as sensibly voluminous in your answer as you are > able.
> i would have said only two: scalar and list, since arrays and hashes
> are both lists.
The question was about variable types, not value types. (The horror.)
In terms of variables, you can start very simply just by looking at the
sigils: $ and @ and % makes three without much effort, and then you can
get a bit more complex and add * and & (what do you mean a subroutine's
not a variable?) for at least another two, then you've got the
invisible-sigil variable types - file handles and directory handles -
and I think by then the interviewer will have got the point.
More information about the london.pm