How robust is your Perl programming vocabulary? Are you able to write Perl and speak Perl code? Take this quiz and find out!

Below is a list of 10 terms. Some terms are specific to Perl while others have application to programming languages in general. Some are hard, some are easy. The answers appear on the next page (or below) and can be revealed by highlighting the colored box. No cheating!

pragma
multidimensional hash emulation
zero-width assertion
rvalue
variable interpolation
compound statement
grave accent
range operator
weak reference
funny character

Continue for answers and to see how to score yourself...

pragma: a pragma is a standard module you can call with "use" to change the behavior of your script at compile time. Pragmas are all lowercase to differentiate themselves from other modules.
Example: use strict; use warnings (availabe in version 5.6);
Score: 1 point

multidimensional hash emulation: a very old way creating multidimensional hash. With a hash emulator, a list of keys (rather than just one) is provided in a hash assignment. The keys are then joined with the contents of $; (chr(28) by default) and used as a single key.
Example: $people{ $state, $county } = $census_results
Score: 2 points if you knew they existed OR 3 points if you knew the syntax and how the keys are joined

zero-width assertion: this term is used to describe metacharacters (e.g. ^ and $) and metasymbols (e.g. \b and \B) in regular expressions that represent locations, not characters, within a pattern. In other words, zero-width assertions are zero characters wide.
Score: 2 points

rvalue: an rvalue is what goes on the right side of an assignment operator. There is also an lvalue that goes on the left side of the assignment operator. In the assignment: $x = $y; $y is the rvalue.
Score: 1 point

variable interpolation: the process of evaluating a variable within an expression.
Example: $foo = "bar"; $x = "$foo"; $x now equals "bar" because $foo was interpolated inside the quotes.
Score: 1 point

compound statement: A combination of expressions and blocks where the blocks are exectuted only if the condition of the expression is met.
Example: if (EXPR) BLOCK; unless (EXPR) BLOCK;
Score : 2 points

grave accent: another name for the "backtick" character ('`')
Score : 2 points

range operator: the operator represented by either two or three dots in a row: (..) or (...). See perlop for examples.
Score : 2 points if you knew what it was OR 3 points if you knew it could take 2 or 3 dots.

weak reference: an experimental feature of Perl that does not increase the reference count of an object
Score : 2 points if you heard of it OR 3 points if you knew about the reference count bit.

funny character: Yup, this is a computer science term as coined by Larry Wall in the Camel book. The funny characters are simply the $, @, %, &, and * symbols that precede a symbol table entry. ($foo, @foo, etc.)
Score: 2 points

OK, how did you do? There were 20 points possible.

0-5: A Visual Basic programmer could do better
6-10: Soon you won't need a pacifier
11-15: I bet you studied.
16-19: You're hired!
20: Which O'Reilly book did you write?

DISCLAIMER: The above answers may reflect the stupidity of the author. Any bad code written as a result of above information shall not be the responsibility of said author. Consult perldoc for further guidance.

$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop";
$nysus = $PM . $MCF;
Click here if you love Perl Monks


In reply to Perl Programming Vocabulary Quiz by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.