<?xml version="1.0" encoding="windows-1252"?>
<node id="255028" title="A Perl aptitude test" created="2003-05-02 11:19:20" updated="2005-08-08 19:30:15">
<type id="120">
perlmeditation</type>
<author id="5539">
Jonathan</author>
<data>
<field name="doctext">
Two years ago I wrote a short Perl test for perspective employees of the company I work for...

&lt;code&gt;
1.	What does following statement do?
print (2 * 3) + 3;

2.	Why is the ‘use strict;’ statement useful?

3.	Write a regular expression that removes trailing white space from a string

4.	What is the difference between a lexical variable and a package variable?

5.	What does the following statement do?
$var = $#array;

6.	What does the ‘&lt;=&gt;’ operator do?

7.	Given the following data structure.
        How would you access the value ‘c’ in the scalar $a?

$a = [
		‘a’,
		‘b’,
		[
			‘c’,
			‘d’
        ],
        ‘e’
      ];

&lt;/code&gt;


The test is part of a larger exam that also covers 'C', Unix, Java and SQL. Candidates are asked to rate their knowledge of the technoglogies from none, fair, good or expert. Therefore, I want the Perl section just to give me an indication that they are telling the truth. If we wanted a Perl specialist I'd do a technical interview with them later. 

The problem is I don't think the test I wrote does this. While some questions seem reasonable to me, I get complaints about others. OK Question 1 is a bit of a trick question - I think I originally saw it suggested on a Perl site and thought it fair enough. But I've seen fairly decent Perl people getting 3,4,5,6 and 7 wrong. &lt;BR&gt;&lt;BR&gt;Does any one have any better suggestions? &lt;BR&gt;&lt;BR&gt;Needless to say that I consider most people who read this site as more than acceptable for our needs!



&lt;p&gt;
   &lt;font size="1"&gt;
      &lt;b&gt;edited:&lt;/b&gt;  Fri May  2 16:19:40 2003 
      by [jeffa] - title change (was: A Perl test)
   &lt;/font&gt;
&lt;/p&gt;
</field>
</data>
</node>
