B# Perl Q1: Which of the following keyword is used to make an object reference?	^A)  Return	^B)  Bless	^C)  Package	^D)  Object 
C# Perl Q2: Which of the following describes the most accurate difference between the "my" and the "local" expression?	^A)  Using my operator variables make the entire script private.	^B)  Local expression is used to declare variables available called within the sub references when arrays or hashes are used as arguments.	^C)  My expression makes variables private so they can only be used in the current sub and not be passed onto other subs called from within the subroutines.	^D)  It allows the variable to be passed on to other subs called from within the subroutine. 
D# Perl Q3: Which one is the least effective method of reducing code errors?	^A)  Use -w switch and create pseudo code before you start.	^B)  Write reusable code and modular approach.	^C)  Declare and initialize variables.	^D)  Keep strings short and use the non strict pragma at all times. 
A# Perl Q4: What is the @ISA array used for?	^A)  It is used for inheritance wherein a class is said to share a relationship with the classes listed within the @ISA array.	^B)  It is to create relations between classes and methods.	^C)  It is to have reusable code in related classes.	^D)  It is to inherit classes among methods. 
A# Perl Q5: which of the following is NOT a common perl error?	^A)  print MYFILEHANDLE ("Perl makes my life easier."); $ INCORRECT	^B)  The == and the eq operators as well as numeric operators (== !=) and string operators(eq,ne) are used as same operators.	^C)  A block of code is not surrounded by braces ({ }).	^D)  An array operator (@) is used incorrectly in scalar context, such as @array[1] when it should be $array[1]. 
D# Perl Q6: how do you write to a file with the filehandle HANDLE?	^A)  write ( HANDLE, "< write something");	^B)  print ( HANDLE, "write something");	^C)  Write ( HANDLE "write something")	^D)  print ( HANDLE "write something"); 
A# Perl Q7: For what are objects used for?	^A)  Makes scripts easier to use and maintain.	^B)  Provide labels for defined code.	^C)  Create package defenition files.	^D)  Divide codes into smaller pieces. 
D# Perl Q8: How do you create a filehandle for appending?	^A)  append ( HANDLE, "write something");	^B)  print ( HANDLE, "< file.txt");	^C)  open ( HANDLE "+>write something");	^D)  open ( HANDLE "<file.txt"); 
C# Perl Q9: Which of the following statement is true?	^A)  Variable declared by my keyword is global in scope.	^B)  Variable declared by local keyword is only available to the subroutine from which they are declared.	^C)  Variable declared by my keyword is available to calling subroutines.	^D)  Variable declared by local keyword is available to subsequence called subroutine. 
C# Perl Q10: The task of the perl's package is to?	^A)  Label a program.	^B)  Encrypt.	^C)  Ceate new keyword.	^D)  Define a namespace for a block of code.
D# Perl Q11: Consider the following program code:^  @array - ( "Y", "W", "X");^  @array = sort (@array);^  unshift(@array, "Z");^  print($array[0]);^  What is the output of this code?	^A. W	^B. X	^C. Y	^D. Z
D# Perl Q12: Consider the following program code:^  $i  "15";^  LOOP: for(; $i < 25; $i++)^  {^  if ($i % 2)^  {^  next LOOP;^  }^  print("$i ");^  }^What is the result of executing this program code?	^A. The code will output the following: 15 2 4 6 8 10 12 14 16 18 20 22 24	^B. The code will output the following: 15 17 19 21 23 25	^C. The code will fail at line 2 because $i is not initialized.	^D. The code will output the following: 16 18 20 22 24
A# Perl Q13: Which of the following choices demonstrates the correct syntax to pass the argument $arg2 to the subroutine get pass?	^A. get pass($arg2);	^B. call &get pass($arg2);	^C. sub &get pass($arg2);	^D. call get pass($arg2);
B# Perl Q14: Consider the following program code:^  @array - ("ALPHA", "beta", "GaMmA");^  @array = sort (@array);^  print ("@array");^  What is the output of this code?	^A. beta GaMmA ALPHA	^B. ALPHA GaMmA beta	^C. ALPHA beta GaMmA	^D. beta ALPHA GaMmA
A# Perl Q15: Consider the following package definition:^  package Convert;^  Which one of the following statements should immediately follow the given package definition to create a valid module?	^A. 1;	^B. use;	^C. sub;	^D. module Convert
B# Perl Q17: Which one of the following statements will add the symbol table for a package into the including package's symbol table?	^A. include Package;	^B. require Exporter;	^C. require Package;	^D. export Package;
B# Perl Q18 Consider the following code:^  %chars = ("a", "100", "b", "90", "c", "80");^  Which one of the following choices will reverse the key/value pairing of the code?	^A. reverse(%chars);	^B. &chars = reverse(%chars);	^C. reverse(%chars) = &chars;	^D. invert/%chars);
C# Perl Q19: Consider the following command:^  per1 runme.pl arg1 arg2 arg3^  Given this command issued on the command line, what is the value of @ARGV?	^A. arg1	^B. runme.pl	^C. arg1 arg2 arg3	^D. 2
D# Perl Q20: The file handle INPUT is associated with the file represented by $file. Which statement will close the file handle INPUT?	^A. close (INPUT, $file);	^B. close INPUT;	^C. INPUT(close, $file);	^D. close(INPUT);
D# Perl Q21: Given the following statement:^  for ($count-0; $count < 5; $count++) {print $count "}^  What will be the output from the given statement?	^A. 1 2 3 4 5	^B. 5 10 15 20 25	^C. 1 2 3 4	^D. 0 1 2 3 4
D# Perl Q22: Consider the following program code:^  $var - 10;^  package Alpha;^  $var - 20;^  {^  package Beta;^  $var = 30;^  }^  package Gamma;^  $var = 40;^  {^  print $var;^  }^  What is the output of this code?	^A. 10	^B. 20	^C. 30	^D. 40
D# Perl Q23: Consider that a file named test.txt contains this line of text:^  One line of test text.^  What is the output of the following lines of code?^  $file = "test.txt";^  open (OUT, "<$file") || (die "cannot open $file: $!");^  seek(OUT, 15, 0);^  read(OUT, $buffer, 5);^  print $buffer . "\n";^  print tell(OUT);	^A. t text^   20	^B. t tex^   19	^C. t text^   19	^D. t tex^   20
D# Perl Q24: Consider the following code:^  %hashA - ("alpha", "beta", "gamma", "albpa");^  %hashA = reverse(%hashA);^  print $hashA{"alpha"};^  What is the result of executing this code?	^A. The code outputs the following:^   alpha	^B. The code outputs the following:^   beta	^C. The code outputs the following:^   gamma	^D. The code fails at line 3.
C# Perl Q25: Consider the following command:^  perl1 runme.pl arg1 arg2 arg3^  Given this command issued on the command line, what is the value of $#ARGV?	^A. 0	^B. 1	^C. 2	^D. 3
B# Perl Q26: Consider the following code:^  $_ - "New York";^  @array2 = split(//);^  What is the value of $array2[0] after this code is executed?	^A. ""	^B. "New"	^C. "NewYork"	^D. "N"
A# Perl Q27: Consider the following program code:^  $y  "1";^  $x = "2";^  $z = "3";^  do^  {^  print ("$y ");^  } while ($y eq "2");^  do^  {^  print ("$x ");^  } until ($x eq "2");^  print ("$z ");^  What is the result of executing this program code?	^A. The code will output the following:^   1 2 3	^B. The code will output the following:^   3	^C: The code will output the following: ^   3 2	^D. The code will output the following:^   3 2 1


