Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Perl quiz for beginners

by jassics (Initiate)
on Sep 09, 2011 at 05:32 UTC ( #925014=perlquestion: print w/replies, xml ) Need Help??

jassics has asked for the wisdom of the Perl Monks concerning the following question:

It's an overview on Perl for beginners.
It contains 15 questions and time permitted is 20 minutes.
If you know the basics you can finish it within 10 minutes at max.
here is the link for that quiz. let me know your review so that I can come up with the next level quiz on Perl
Perl Overview Quiz for beginners

Replies are listed 'Best First'.
Re: Perl quiz for beginners
by davido (Cardinal) on Sep 09, 2011 at 08:41 UTC

    If I saw that quiz at a potential employer I would cross them off my list; I don't need work that badly.

    Here are a few of the specific issues:

    • "What does Perl represents?" is not proper English. You intend to be asking "What does Perl represent?", but that only corrects how the question is worded. But to imply that Perl must represent something as an acronym is fallacious. It has been ascribed several meanings, but only retrospectively. It doesn't necessarily have to stand for anything.
    • "Who is the founder of Perl?" is poorly worded. Larry Wall didn't found Perl, he wrote Perl. He's its original author. He now takes on a different role, while others maintain and contribute to the project.
    • "What CPAN means?" is improper English. You intend to ask "What do the letters in CPAN stand for?"
    • When I see "Diff b/w chop and chomp" I think "black and white" (like old televisions), not "between." And you're authoring a quiz. Please no home-brewed abbreviations. "What is the difference between chop and chomp?" And the correct answer is not sufficiently accurate.
    • Don't confuse the issue by using "unlink($file)", just ask "Which function deletes a file?", with "unlink" as the correct answer.
    • If you're going to use the wikipedia definition of autovivification maybe it should be attributed.
    • The correct answer on the shebang question is poorly written. There is no verb. It should start with "It is..."
    • Who cares which is the latest stable version of Perl? And are you prepared to update that question every time a new version of Perl is released? Furthermore, the latest stable version may not be available on all operating systems at the same time, so perhaps it should be qualified as "currently released.", or better, you should come up with a real question that actually matters and doesn't change frequently.
    • I've been checking what Perl version I have available to me with the command line "perl -v" for years, so if that's not the right answer I guess I've been getting bad information for years. I've never used $] from the command line, and can't imagine why I would. The question is also not a complete sentence; it lacks a verb. If your intent is to output only the Perl version and nothing more, reword the question to say "Which of the following one liners will output the Perl version number, and nothing more?
    • Maybe you mean to ask, "What is a JAPH?" (which seems like a really lousy "Perl skillz" question). And your "correct" answer is wrong. merlyn coined the phrase, and it's spelled, "Just another Perl hacker,"
    • Should be: "Which of the following is a valid Perl comment?"
    • "Which of the following sigils precedes an identifier representing a scalar variable?"
    • The next question should be: "Which of the following represent a valid filehandle?" And the answers are all correct because any bareword following Perl's rules for identifiers could be a valid filehandle. If you're asking specifically about the default filehandles, they're all full caps, and the question should ask specifically which are the default filehandles instead. And as someone mentioned, your choice to not also present lexical filehandles is unfortunate.
    • The last question would result in a compiletime error message, so the correct answer isn't even available as an option.

    I am sure that a critical eye would find fault with some of my answers here as well, which will lend credence to this next statement. Good test questions and well chosen answer sets take a lot of thought to compose; a concept that too many teachers fail to recognize. I hate multiple choice questions because I'm constantly asking myself, "Do they want the correct answer, or the answer that I suspect they think is correct?" I do think that the questions themselves would do a poor job of distinguishing a good programmer from a bad one.

    I have retyped the next paragraph so many times that I've decided to refrain from saying any more on the subject.


      If you're asking specifically about the default filehandles, they're all full caps,

      If you are talking about STDIN, STDOUT and STDERR then perl has always (AFAIK) supported the lower case versions stdin, stdout and stderr although ARGV, ARGVOUT and DATA have to be upper case.

      $ perl -le'print for grep /^std/i, %::' stderr stdout stdin STDOUT STDERR STDIN $ perl -v This is perl, v5.10.1 (*) built for i486-linux-gnu-thread-multi Copyright 1987-2009, Larry Wall

        Does it support Stdin, Stdout, and Stderr? Because that's how the answers were worded: In ucfirst format. (And if it does, then holy cow, I'm still a beginner!)


      Few of them were mistakes due to MS word like Stdout instead of STDOUT. I am sorry for that.

      Yes, lots of efforts are needed before posting full proof expert like quiz. I am beginner in Perl programming and got many things from these comments that how much effort I need before posting anything here or even in our website.

      Thanks for all expert comments. Criticism is always good for someone (here for me :)).

      I will try to put next quiz after experimenting and testing a lot.

      Davido, as per your comments I modified many questions and answers. hope there will less bugs now.

      Perl acronym will always be there even t doesn't mean so. Check Wikipedia or any good universities documents. It will be there. ex: (Canergie Mellon University). So let ti be there for our reference in case if its asked.

        If anything, it's a Backronym, which makes its inclusion in your quiz a poor choice. If you must include it, call it what it is, and don't try to make it look like the name Perl was an artifact derived from a chosen longhand phrase.

        Which "good university" has documents stating that Perl is intended to be an acronym?

        Before you start telling people to refer to Wikipedia or some vague university's "documents", you should RTFM, or in this case, RTFFAQ: perlfaq1: What is the difference between perl and Perl?. I won't cut-and-paste it here, but you will find that the Perl documentation disputes your assertion.

        While you're at it, you can confirm my JAPH comment here: perlfaq1: What is a JAPH?


        "Check Wikipedia or any good universities documents. It will be there."

        Not because I care all that much about the specific issue -- whether the name has some specific acronymic meaning, but rather, because you're suggesting that seconday (and very possibly inaccurate) resources should be grounds for ignoring a primary resource, such as Larry Wall's own remarks.

        Now, I'll grant that I've not found (in the archives of comp.lang.perl.misc) a statement signed by Wall, nor audio or video of Wall disputing the notion that "perl" or "Perl" is an acronym, nor have I ever had occasion to ask timtoady 'what's the fact?' but the assertions of numerous Perl pioneers (including a good many Monks of Great Tenure; merlyn, tilly (see [Re^5: perl not omnipotent? let's see!), petdance....) are, to me, far more persuasive than sources such as wiki, CS departs at .edus, etc.

        Likewise, IMO, the widely reported story that a witty writer invented a backronym to explain his name choice (or as a joke) seems more plausible than that he departed so radically from the common use of

        • pedestrian acronyms (COBOL, BASIC, etc.),
        • personal initials (awk, for example)
        • or personal names with historic CS significance (ADA)
        as denominators for computer languages.
Re: Perl quiz for beginners
by cdarke (Prior) on Sep 09, 2011 at 07:12 UTC
    Perl is a name, not a set of initials (although that is open to interpretation).
    Autovivification: it is more than the supplied answer
    The shebang line for the use described is UNIX specific, it is a special comment on, for example, Windows.
    Command to use to know Perl version only using command line is poorly worded, and please explain why perl -v is wrong.
    Valid File handlers did you mean "file handles"? In which case, none of the supplied answers are correct with use strict, anyway, you should be teaching begineers lexical file handles, not bare-words.
    my $prize = “5 Dollars” print ‘You got $prize’; will give a syntax error because there is a missing semi-colon before the print

    These questions are way too thin to give any indications as to the skill level of the participant, and anyway, with TMTOWTDI, just having one possible answer is questionable.
      Many many thanks for your awesome feedback "cdarke"
      I know I need to learn many things in Perl. I am just experienced beginner in perl :D
      That's why I joined Perl monks to hone my skills and learn & share with you.
      Yes Perl is a name but everybody asks what is it's full form and I need to say it, so put this question in quiz.

      Yes I just kept example of it. It should be path to Perl interpreter. ex: c:/opt/perl/bin/perl

      I asked "Perl version only" all other options except $] would fetch more information that just version number/string Yes Autovivification is more than that but I thought it would be enough to give idea in one line

      Yes very true but here motto was to ask which keywords are meant file handles and answer would be STDIN, STDOUT, STDERR

      I checked and semicolon is there.
      and yes this was meant for Perl beginners only. But it's good to get expert's comments so that We can work much harder way to have expert level participants in future.

      Thanks for joing us at Aliencoders. Wish to hear a lot from you there :)
        Yes very true but here motto was to ask which keywords are meant file handles and answer would be STDIN, STDOUT, STDERR

        Then please write STDIN, STDOUT, STDERR. I thought you did mean a, b and c.

        And a, b, c are also valid file handles:

        $ perl -wE 'use strict; open a, "<", "TODO"; say <a>'

        It is also slightly annoying to have several correct answers within a poll; the question which of several correct answers is more correct doesn't make sense, if you start thinking about it.

        Thanks for the quiz anyway.

        "Yes Perl is a name but everybody asks what is it's full form and I need to say it, so put this question in quiz."

        Nonsense, BS, indefensible rationalization/justification because the answer is wrong.

        Visting unknown site such as yours, I don't allow js or cookies (among other personal quirks). So I can't get past Q1, though from this nodes' grandparent, I can deduce the questions. But, frankly, the comments below from moritz, davido and jwkrahn persaude me that I haven't missed anything valuable.

        And further re davido's comment about teachers and quizes, the teacher who's trying to fake competence with knowledge a scant chapter ahead of the student on a topic in which neither is expert is almost guaranteed to provide misinformation.

        Update : Oh yes, it's considered bad form here to post your data offsite: if it's not posted here, it may not be there, sometime in the future, and thus the value of the entire thread is apt to be lost.

Re: Perl quiz for beginners
by eyepopslikeamosquito (Bishop) on Sep 09, 2011 at 10:56 UTC

    Typo alert: question seven has the phrase "It is sed" twice. The use of English in your quiz needs improving.

    Also, the quiz has no humour. At all. I think humorous options to one or two questions would improve it. For some example quiz questions (some of which have humorous alternatives) see Running a Perl Quiz Night.

    From the draft Oxford English Dictionary entry cited on

    Perl Brit.
    Perl, perl, irreg. PERL
    perl n. ,
    arbitrarily chosen for its positive connotations, with omission of -a- to differentiate it from an existing programming language called Pearl. Coined by Larry Wall in the summer of 1987; the program was publicly released on 18 December of that year. Acronymic expansions of the name (such as Practical Extraction and Report Language and Pathologically Eclectic Rubbish Lister), though found in the earliest documention for the language, were formed after the name had been chosen. Coinage details confirmed by personal communication from L. Wall, May 2000. A high-level interpreted programming language widely used for a variety of tasks and especially for applications running on the World Wide Web. The form Perl is preferred for the language itself; perl is used for the interpreter for the Perl language.

      Oops seems typo mistake. modified and updated.
      Thanks to all of you who made that quiz little worthy now :)
Re: Perl quiz for beginners
by blue_cowdawg (Monsignor) on Sep 09, 2011 at 13:49 UTC
        let me know your review so that I can come up with the next level quiz on Perl

    I'm not sure your quiz is quite the right tool to test the knowledge of beginning Perl programmers. Having taught Perl at the college level I am speaking from experience.

    If your the objective of the test is to test a person's knowledge of Perl culture, then this quiz is OK. However if you are trying to determine if someone at the beginner's level can program in the language then the quiz falls far short.

    If I were designing the quiz I'd have asked more questions having to do with the actual programming of "things" in Perl (such as your questions about file descriptors, perlvars, etc) and less on TLAs and history.

    But then, that's just how I write tests.

    One thing I'd caution you on though when writing a test about programming in any language and especially Perl. There Is More Than One Way to Do It comes to mind. What I'd consider to be the "right solution" to solve a problem may not be a student's "right solution" and both could be valid.

    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
      Nice to know about you Peter. This quiz was just to make familiar with these terms so that nobody says that being a novice you don't know what is what. From the next session it will be fully practically code based and will have three level.....novice, intermediate and expert for each and every topic............... Ex: questions on variables Question on inbuilt functions for variables etc or all of you can suggest us topic, contribute few question then we together can come up with nice quiz which will be helpful for all sort of people in Perl domain

        Me, being me, would ask questions like

        What value is printed using the following code? my $i="abc"; $i++; print $i,"\n";

        Peter L. Berghold -- Unix Professional
        Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
Re: Perl quiz for beginners
by Guenhwyvar (Scribe) on Sep 09, 2011 at 14:27 UTC
    Too bad your method for determining the version of Perl doesn't work well in all environments.
    [174] perl -e "print $];" Illegal variable name. [175] echo $SHELL /usr/bin/tcsh [176] bash bash-3.00$ perl -e "print $];" 5.008005

      That is because he is using Windows. On windows the quotes are ". On all other (sane) systems, the non-interpoliting quotes are ', which is what renders any quiz that involves quotation useless if it is to span Windows and any-other-OS.

      FWIW I didn't even start the quiz as it took way too long loading and when loaded (don't remember if I waited for a full load) requires cookies/scripting

    Enjoy, Have FUN! H.Merijn
Re: Perl quiz for beginners
by raybies (Chaplain) on Sep 09, 2011 at 12:42 UTC

    my question 14 (dunno if it's mixed up) there was a typo: "Defualt" (filehandles...)

    ALso I contend that Pathologically Ecclectic Rubbish Lister is the correct Backcronym for Perl, and I will stand by that til the day I die...

    So unfortunately I got them all right save one... :( but in my heart, I got'em all... :-P


Re: Perl quiz for beginners
by egga (Monk) on Sep 09, 2011 at 10:08 UTC

    I appreciate your effort to make that quiz. It's a nice idea and I pretty much like your GUI.

    A big drawback is the quality of your questions, but I'm sure, that you are improving them over time.

    I personally prefer questions, which need knowledge of the language itself (e.g. "what does ... print") over questions, which need "meta knowledge" of the language (e.g. what does XYZ stand for). But I have to admit that the Perl ecosystem is quite overwhelming and understanding the community is one very important key to learn the language.

    I hope you keep up that work and provide questions for more experienced developers very soon. Thanks for your time and sweat.

      Thanks Egga for your feedback and yes agree that question was of lower level. Main target is Perl novice not intermediate or expert like all Perl Monks people.

      i posted this quiz here to know every one's idea and I succeed in that.

      I will surely devote more time before posting my next quiz and that will be for all. (Experts don't require it but their views are always accountable :))

      If any of Perl Monks want to contribute their questions then please forward a mail to or
      So that I can put these questions for next quiz. It will help many people who work on Perl

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://925014]
Approved by moritz
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2022-06-27 05:07 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (86 votes). Check out past polls.