Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Perl Questions Asked at Interview

posted by pudge on 2000.04.07 15:43   Printer-friendly
Mike Phelan writes "I was recently asked these three questions about Perl, during an interview for a position. 1)How do you instantiate a new instance of a hash table? 2)What does $$ represent in Perl? 3)What does $! represent in Perl? "

I just hope you got them right.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Lots of people can do well on tests but have questionable (!) coding skills. A previous employer of mine instituted a programming test in the hiring process, and as a result they had no dead weight on staff. This is a Good Thing.
  • The second and third question are pretty straight forward, but it's totally unclear to me what they mean by the first question. "New instances" is something you expect when talking about objects, but Perl ain't Java or Python, and hash tables aren't objects. Do they perhaps want to empty a hash? (Use ()) Create a new hash? (Just use it) Copy a hash? (%copy = %old;) Deep-copy a hash? (Can't be done in pure Perl if there are code references present, else use Data::Dumper)

    -- Abigail

  • At the risk of being hated, ridiculed, and forced to perform mime in a Parisian-themed family-style restaurant, here are "the answers" to the questions which I posed from my recent interview. instantiate a hash [cmu.edu] %myHash $! If used in a string context, $! [cmu.edu] yields the corresponding system error string. $$ $$ [cmu.edu] yields the process number of the perl running the current script. Thanks to everyone who responded. Hi Joe.
    --
    And do you want to know what the secret is? You have to care. And you have to try.
  • * What does '@' and & mean in Perl ? * What is a 'Package' in perl? * What are Perl Regular Expressions? * Perl Regular Expressions are greedy. what does that mean? * What are Associative Arrays in perl?
    • Q. What are Associative Arrays in perl?

      A. Obsolete nomenclature for Hashes, only called such by us ancient AWK programmers.

      --
      Bill
      # I had a sig when sigs were cool
      use Sig;