1. What is @INC?
2. You may call a subroutine called 'subrout' with arguments 'args', using:
3. How many scalars will the array @num have after the following command: my @days = qw (Sunday Monday Tuesday Wednesday Thursday Friday Saturday); my @num = (1..scalar @days);
4. What does the 'shift' function do?
5. What is the shebang?
6. How would you output the list of keys in a hash?
7. Does perl require variables be declared with a type? (ie: int, float, double, etc.)
8. $m=ucfirst('test'); What will be the output of $m?
9. lc function stands for?
10. You may force yourself to declare your variables by:
11. Which conditional statement is equivalent to 'if (!)'?
12. What can be used in PERL for communicating with an FTP server?
13. To remove any line-ending characters of each string in a @list, you use the function:
14. What is $_ ?
15. Which get you an array of all numbers matched in a string?
16. Unless it is the final statement in a block, every simple statement must end in:
17. Will perl be installed in Windows by default?
18. Which will check the script's syntax?
19. How can perl be called which gives the same functionality of 'use warnings'?
20. my $x=join(':','a','b') What will be the output of $x?
21. The for loop has few semicolon-separated expressions within its parentheses. These expressions function as:
22. Does Perl provide the defined function that allows you to check up if a variable has the undef value or not?
23. Can a pattern search be done in a split function in PERL?
24. How do you check the existence of a key in a hash?
25. The prototype symbol for a scalar is:
26. What code output? for ($count = 10; $count >= 1; $count--) { print '$count '; }
27. Ways one can run an Unix command?
28. What will $count= scalar keys %hashname; return?
29. What is a hash identified as?
30. What program do: foreach (reverse 1..10) { print; }
31. What does cdup () do in FTP?
32. Perl programs have this filehandle that is automatically opened:
33. Perl has a 'goto' command.
34. How can you install a module?
35. What's the preferable mode of executing one CGI script?
36. How do I call subroutines in Perl?
37. Why would I include strict in PERL code?
38. Which function is not used for array processing?
39. How do I close a file?
40. how would you execute a shell command from within a perl script
41. Which function is not used for hash processing?
42. How would you remove an element from hash?
43. What's is DBI and DBD?
44. What does Perl -e on the command line do?
45. Which would declare a global variable?
46. To execute blocks of code depending on whether a condition is met, you use:
47. $_ is used by default:
48. Which is not used for assigning a value to a variable?
49. To disable a database error, what parameter is set in the database initialization?
50. my @b=(1,2,3);my $a=@b;What will be the output of $a?
51. How do I lock a file?
52. Which regexe matche between 1 to 4 ab's followed by a tab and an integer number?
53. How do I numericaly sort an array in decending order?
54. Output of variable $firstVar after completion of this code line: $firstVar = substr('0123BBB789', 4, 3);
55. Can I call the method of a class without creating an object?
56. what is the default separator in split operator
57. How would you check which version of perl you are using?
58. What statement immediately ends a subroutine?
59. You can create a reference to an existing variable or subroutine by prefixing it with a:
60. What must be done to pass more than one array or hash into or out of a function and have them maintain their integrity?
61. Which regular expression deletes all tags specified as text enclosed by '<' and '>' from a document stored in a string, but deletes nothing else?
62. What's the system() success value?
63. The bitwise AND operator is:
64. What does append do in FTP?
65. What does $! show?
66. What is closure referencing?
67. To dereference $arrayref and then find the second element of that array, you use:
68. What option do I use to check the existence of a file?
69. How do I dereference a hash reference?
70. our @ISA (person); What does @ISA mean?
71. What function is used to check the length of a string?
72. Which is not used to control scoping?
73. I can capture output of any unix command through which process?
74. Which takes care of garbage collection?
75. How to create a super class object?
76. What does Perl -T do?
77. What will be the @arr value after executing: my @arr = grep { $_ > 0 } map { $_ * $_ } (1, -1, 2, -2);
78. What does chop do in PERL?
79. $@ is used in association with the ____ function.
80. What does unshift do?
81. All arguments to a subroutine are passed as:
82. What would be $x after my $x = '5' x '4';
83. Perl -I, what is 'l' meant for?
84. What is known as a reference to a function that is, usually, passed into another function for use?
85. How can you write content using CGI?
86. How do I create an object?
87. @values = ( 'value1', 'value2', ('value3', 'value4') ); How does Perl store the nested list shown above?
88. What do the @- and @+ arrays do?
89. What module is used to scrape contents from website?
90. A perl program file name prog.pl starts with the following line: #!/usr/bin/perl -w The file has execute permissions. What would be the difference between: (a) ./prog.pl (b) perl prog.pl
91. if $as==if $as=='x', then what is the output? print 'as'.'$as'.$as.''
92. How would I display an error during CGI application?
93. Perl stores numbers internally as:
94. 1 $a='cat'; 2 $$acatches='rat'; Which is equivalent to second line.?
95. ?!pattern means regular expression is:
96. Which list items of stat() returns the mode of the file?
97. What is a correct way to instantiate parallel processing in PERL?
98. What should be the output of @nums = (1..10); splice(@nums, 5,5,21..25)?
99. seek FILEHANDLE, POSITION, OPTION; What's meant by option value as 0 ?
100. What is %INC?
101. Which is a correct use of IMAP?
102. which operator has highest precedence
103. What is the difference between require and use?
104. $b = $a++ + ++$a; What is the value of $b?
105. what is the output of $x'AGAAA'; $x=~tr/AG/C/ds; print $x;
106. Which will remove a cookie?
107. How can you get the current postion of the file?
108. How can I read character by character from a file?
109. What does +>> signify in file handling?
110. Which expressions allow you to enter the perl debugger without running a program?
111. What will be in $test variable? my $test = ( ($a,$b) = (7,7,7,5,45));
112. When is begin block evaluated?
113. How do I handle transaction control in PERL?
114. What does $1 hold? $x= 'a walk in the park';$x=~/(.+)a/;
115. For the string '2011/12/04' and regular expression '/(\d+)\/(\d+)\/(\d+)/', you can use $3 to return '04'. What other variable can be used to return '04'?
116. What does die() do?
117. what is the purpose of the `qw` keyword in the statement: my @array = qw/apple orange grape/;
118. Which is not true of labels?
119. An atom cannot be
120. The bless operator
121. What are bare words?
122. What does the following compound assignment operator signify? | =
123. The syntax of assigning to an array cell is.
124. What does the pattern modifier m do?
125. The value assigned to an array cell must be.
126. Dereferencing refers to.
127. Which meta character creates a single expression or atom?
128. Which begin or end a system command string in Perl?
129. Which loop is usually used to process array?
130. Which parameter does the printf function take?
131. A scalar variable can contain.
132. The syntax of the heredoc operator is.
133. What does the abs_path method do?
134. Context in Perl can be.
135. Which execute the continue block of statement before returning execution to the top of the loop?
136. Which is not a type of reference variables?
137. Which is not a rule for switches using the Getopt function?
138. Which is not true regarding scalar variable names?
139. What is meant by variable interpolation?
140. Which switch syntax option is the following code an example of? GetOptions('extension:s');
141. When are the environment variables created?
142. Which is not a feature of Perl?
143. The foreach loop is usually used to process.
144. What does the pop function do?
145. A label, in Perl, is.
146. Which pertain to IO: :Handle?
147. How are hash references created?
148. What does the syntax indicate? $lvalue=join(delimiter, list);
149. Which Getopt::Long Configuration variables refers to an internal error flag?
150. What does a print FILEHANDLE list do?
151. Which translation modifier matches all characters that are not part of the search string?
152. Scalar variables can contain.
153. Which character is the variable designator for scalar variables?
154. Which can replace if else?
155. Which operator is associated with writing to a program?
156. What does @ARGV refer to?
157. A directory handle.
158. The keyword 'my' is used to declare
159. The syntax of the sort function without a special purpose sort subroutine is:
160. Which is a part of the if family of branching statements in Perl?
161. What does the ord string function do?
162. Which file function gets the file descriptor of a file handle?
163. How many times does the do statement allow you to execute the block of statements in a loop?
164. What does the switch syntax :f do?
165. What is the following code an example of? $hitCounter=sub {print 'This page has been called $hits times';};
166. What does the directory function telldir do?
167. Which operator has/have the highest precedence?
168. What does the following error indicate? 'Can't Locate Function in @INC'
169. What should be the first character of a format code?
170. To start the Perl debugger, what will you type at the command prompt?
171. The s/// function.
172. How is an array assigned to an array?
173. Non-associative operators are those that.
174. Which can be used with the do statement?
175. Which character denote a comment in Perl?
176. Which variable contexts do not care what the return value is?
177. Which control structure can be used to execute only when a condition is false?
178. What does PrintRet do?
179. Which is Basic Input and Output Functions in Perl?
180. The '%' operator returns?
181. How do I replace every TAB character in a file with a comma?
182. What is the following code output? (check all that apply)foreach my $operator ( qw(+ − * /) ) { my $result = eval '2 $operator 2';
print '2 $operator 2 is $result\n';
183. Which function renames an existing file?
184. What is the purpose of the -w switch in Perl?
185. Which operator can be used to take the bottom item from an array?
186. PERL Conditional Statements are:
187. Which option would you use to stitch a list of strings into a single string?
188. Tk support keeps the event loop of Tk __ while reading the prompt.
189. Rather than using print, what is often used in Perl when formatting is important?
190. Which supports FileHandle methods that correspond to Perl special variables?
191. Which function opens a file in writing mode after truncating the file?
192. What is the purpose of using the FILE literal?
193. Which statement is correct about Hash Functions?
194. Which command line arguments are stored and how would you read command-line arguments with Perl?
195. Which operator immediately ends execution of the loop?
196. What do the Relevant library modules include? (check all that apply)
197. Which is Classes and Objects in Perl?
198. CPAN stands for comprehensive Perl archive Network and its a collections of Perl?
199. Which correctly describes Array data types in Perl?
200. Output of the code snippet? sub skipper_greets { my $person = shift; print 'Skipper: Hi there, $Perl!\n'; } sub gilligan_greets { my $person = shift; if ($person eq 'Skipper') { print 'Master: Sir, yes, $Perl!\n'; } else { print 'Master: Hi, $Perl!\n'; } } skipper_greets('Master'); gilligan_greets('Skipper');
201. The overload module provides the following public functions?
202. How many operands are used in a conditional operator? (also called a trinary operator)
203. Perl's text-handling capabilities can be used for generating mySQL queries ____ hashes, and automatic momory management?
204. Explain what is STDIN?
205. Perl effectively inserts a call to the _____ DB::DB(linenum) in front of every place that can have a breakpoint?
206. Which statement is correct about Default ?
207. What is Perl?
208. What is in regard to the benefits of Perl programming when using it in web based applications?
209. Which special variable represents current line number?
210. What value do variables have before they are first assigned?
211. Which Library Modules are available in Perl? Check all that apply.
212. What is the default scope of perl variables?
213. Which data types are supported in Perl?
214. What will be printed by the code below? my @a = (0, 1, 2); my $b = @a; print $b;
215. A library is a set of ___ for a particular purpose?
216. Which command typically use AutoSplit by the MakeMaker utility?
217. What is the result of the code? $pvt = Calculation(6,4,8,12); print('Result = $pvt\n'); sub Calculation{ my ($fstVar, $secndVar) = @_; my $square = sub{ return($_[0] ** 2); }; return(&$square($fstVar) + &$square($secndVar)); };
218. The Perl interpreter keeps track of the length of a _____ as well as its contents?
219. A compound statement usually contains?
220. Which are types of Perl variables?
221. What is STDERR?
222. In order to 'store' an operator inside a variable in Perl, you would use:
223. Which statement restarts the loop block without evaluating the conditional again?
224. If the file is opened for write or append, you can write to the filehandle using which print function?
225. Perl package manager is the ActiveState tool for precompiled perl ................
226. What is the purpose of close() function?
227. Which is breaking out of loops? (check all that apply)
228. Arrays are denoted by _____ in Perl?
229. Which operator encloses a string with-in single quotes?
230. Perl supports ___ main loop types?
231. Which are special file handles?
232. State variables maintain their state and they do not get _____ upon multiple calls of the subroutines?
233. Define a sample perl hash of arrays using the code?
234. In Perl, a floating-point scalar value consists of the following? (check all that apply)
235. Which is true about dereferencing?
236. What are the logical operators in Perl?
237. Is a continue block executed if a redo statement restarts the loop? (choose all that apply)
238. What are the data types available in Perl language?
239. Which function opens a file in writing mode without truncating the file?
240. How can you work through an associative array in a specified order?
241. What will be the size of the @fields array? my $record = ':a:b:c:'; my @fields = split(':', $record, -1);
242. Which code is True of Variables-Hashes?
243. Which statement is correct about Hashes?
244. Which method pops off and returns the last value of the array?
245. Perl 5 defines _____ special subroutines that are executed at specific times?
246. Which modifier can be used when matching in Perl to ignore case?
247. What will be the value of $1 after execution of the code?
248. Which operator performs exponential (power) calculation on operators?
249. Which statement is True of scalar context?
250. Perl supports _____ operations on integer scalar values?
251. Which operator increases integer value?
252. Which is True about operator?
253. Which function can be used to launch a child process to run a program in Perl?
254. Which are kinds of scalar values Perl supports?
255. When does the 'require' function load?
256. Which are the configuration types in Spring?
257. Which function returns true if the named key exists in a Hash?
258. Autoloading of Perl functions is analogous to dynamic loading of compiled ____ functions?
259. The last and next statements are ideal for ............. that check for exceptional conditions?
260. What will be printed by the code below? my $val = bless {}, 'MyClass'; print ref($val);
261. What will be printed by the code below? my $val = {}; print ref($val);
262. In Perl 5.26.1, what is the default value of the debugging configurable option, windowSize?
263. Output of the Perl command? print v102.101.111;
264. Which Perl debugging commands is used for displaying all the commands that are longer than one character?
265. Which Perl function returns the casefolded version of an expression?
266. In Perl, which operator is used for determining the variable to which regex is applied?
267. In relation to Perl arrays, which is a special variable that is used for determining the index of the last element in an array?
268. The correct output of the Perl code snippet? package Exp1; our $exp2; $exp2 = 45; package Exp2; our $exp2 = 85; print $exp2; our $exp2; print $exp2;
269. Output of the Perl code snippet. $var = 'First Example'; $y = 48; $output = 12 + $y; print For variable $var' . ' we have, $var.\n';
270. In relation to Perl security mechanism, select, which of the statement is/are correct? i) Arguments to print are always checked for taintedness. ii) Hash keys are never tainted
271. In relation to tying arrays in Perl, which options are used for providing $#array and equivalent scalar(@array) access?
272. Output of the subroutine in Perl 5.26.1? BEGIN { my $var = 86605; *RT_86606 = sub () { return $var }; $var++; } print RT_86606();
273. In Perl, a comment starts with which option?
274. Output of the Perl code snippet? 'PPQS' =~ /P+Q?(?{print 'Count=$count\n'; '>
275. What will be the output of the following Perl code snippet?
print @exps = (1) x 5; print @exps, '\n'; @var = (3) x @exps; print @var;
276. Which Perl Pod command option implies that the words in text should not be broken across lines?
277. Output of the Perl program? my $out = 'Apple and Mango'; my $inr = 'Almond and Walnut'; my $ptn ='Apple and Mango'; my $inr = 'Almond and Walnut'; my $ptn = qr/(\S+) and (\S+)/; sub output_n { print qr/(\S+) and (\S+)/; sub output_n { print
278. Output of the Perl code snippet? my $exp = 1; $ENV{'xxx'} = \$exp; system($^X, '-e', q/print ( ref $ENV{'xxx'} ? 'Example' : 'Perl' ) /); '>
279. Which Perl function execute(s) a system command and never return(s)?
280. Which Perl operator has the highest precedence?
281. Output of the following Perl code snippet? local $var = 55; $exp = 'var'; { my $var = 25; print $$exp; }
282. Output of the Perl code snippet? local $var = 55; $exp = 'var'; { my $var = 25; print $$exp; }
283. In relation to taint mode in Perl, the setuid bit in UNIX permission is mode:
284. In relation to Perl diagnostics, which option is/are nontrappable?
285. What is output of the Perl code snippet? $var = 'Nina'; print PASSWD '${var}::0:0:Superuser:/:/bin/perl\n'; print 'Say hello! to ${var} when ${var}'s here.\n'; '>
286. Output of the Perl code snippet? @exp = (4, 7, sort 6, 5); print @exp;
287. In Perl, which option is used for denoting entire arrays?
288. Which is the correct features of Perl?
289. Output of the Perl program? use Scalar::Util 'blessed'; my $var1 = {}; my $var2 = $var1; bless $var1, 'Class'; print blessed( $var2 ) // 'happy blessed'; $var2 = 'Something else'; print blessed( $var2 ) // 'not happy blessed'; '>
290. In relation to perltie, a class implementing tied scalar should define which method? i) TIESCALAR ii) FETCH iii) STORE
291. What will be the output of the Perl code? $_ = 'Mark is to the left of red window.'; if ( /\b(red)\s+(\w+)/i ) { print '$2 follows $1.\n'; }
292. Which option is less secure than the other, and should not be used for authentication?
293. Which statement is/are correct about the command paragraph of perlpod? i) The '=item' command should be used outside of the '=over'... '=back' region. ii) An '=item' should be the first thing after an '=over' command unless there are not going to be any items at all. iii) The '=headn' command cannot be put inside an '=over'... '=back' region.
294. In relation to identifier parsing in Perl, which of the following options is invalid?
295. In relation to use strict; in Perl, a variable must be declared with which of the following keywords in order to use it for the first time?
296. Which Perl debugging commands is used for displaying all the loaded modules and their versions?
297. Which command is used to confirm the installation of Perl on the Windows operating system?
298. In Perl, which is a non-whitespace character?
299. In Perl, which is the correct syntax for declaring a subroutine with attributes and prototypes?
300. In relation to perltie, which method is triggered each time the tied variable is accessed?
301. Output of the Perl code snippet? print 'T'; my $var1 = qr/(?{ BEGIN { print 'P' } })/; my $exp = 'exp'; /$exp$var1(?{ BEGIN { print 'Q' } })/; BEGIN { print 'S' }
302. Which Perl command is used for displaying the information about any Perl function?
303. Which operator is NOT used in Perl?
304. Which value is returned by the Perl eof function if the next read on FILEHANDLE returns the end of file or if the FILEHANDLE is not open?
305. Which is the correct syntax of a subroutine that makes a positional parameter, say 'right', optional? (Assume the name of the subroutine as example, and left and right as the positional parameters.)
306. Output of the Perl program? use strict; my @x = ('Red', 'Blue', 'Black'); print `@x = ` . '@x\n'; my ($Mary, $Lisa, $Lara)= @x; print '$Mary $Lisa $Lara\n'; my ($here, $there)= @x; print '$here $there\n'; my ($this) = @x; print '$this\n'; my $this = @x; print '$this\n'; my ($a, $b, $c, $d, $e)= ('a', 'b', 'c', 'd', 'e'); print '[$a] [$b] [$c] [$d] [$e]\n'; ($a, $b, $c, $d, $e)= @x; print '[$a] [$b] [$c] [$d] [$e]\n'; my $var_a = 'Monday'; my $var_b = 'Friday'; ($var_a, $var_b)= ($var_b, $var_a); print '$var_a $var_b\n';
307. Which Perl command will print the output, 175?
308. Which statement is/are correct about Perl Pod processors? i) All three well-known newline formats: CR, LF, and CRL must be recognized by the Pod parsers. ii) Input lines of any length must be accepted by the Pod parsers.
309. In Perl, which option is used for ending a Pod block?
310. In relation to Perl subroutine signatures, which type of parameters can be nameless?
311. Output of Perl program? @x = ('What', 'are', 'you', 'doing?'); print '\We have (@x).\n'; $y = $x[1]; print '$y $x[3]\n'; $xsize = @x; print '$xsize\n'; print '$#x\n';
312. Output of the Perl code snippet? print (3+4)+5; print "\n", +(3+4)+5;
313. Which option is Perl string comparison operators?
314. In relation to Perl taint mode and @INC, which command line options is used for adjusting @INC from outside the program?
315. In Perl, which quotation marks are required for interpolating special characters such as newlines \n?
316. Which number is legal in Perl?
317. Output of the Perl code? $var1 = 3; $var2 = 5.5; $var3 = $var1 + $var2**2; $var1++; print 'First output: $var3 + 2\n'; print 'Second output: ', $var3 + 2,'\n";
318. Which should be the first character of a verbatim paragraph?
319. The code will throw an error. Output of the code line in Perl 5.26.1? print ']' =~ /]/;
320. Output of the following Perl program? strict; sub example { @_ % 2 == 0 or die 'example: Ends\n'; my %ps = ( 'string' => 'Perl', 'between' => ' ', 'repeat' => 1, 'cascade' => 0, 'blankafter' => 1, @_); my $str = substr($ps{'string'}, 1); $str =~ s/(.)/$ps{'between'}$1/g; $str = substr($ps{'string'}, 0, 1) . $str; my $p = 0; for(my $n = $ps{'repeat'}; $n--; ) { print ((' ' x $p), '$str\n'); $p += $ps{'cascade'}; } print if $ps{'blankafter'}; } example; example(repeat => 2, string => 'EXAMPLE', cascade => 2); example(between => ' '); example(between => '==', repeat => 3); example(string => 'END!!', blankafter => 0); '>
321. The following program, when executed, should generate the output, 'Sample'; however, the program contains an error. Identify the line with error. 1) sub try (&@) { 2) my($try,$catch) = @_; 3) eval { &$try }; 4) if ($@) { 5) local $_ = ; 6) &$catch; 7) } 8) } 9) sub catch (&) { $_[0] } 10) try { 11) die 'Example'; 12) } catch { 13) /Example/ and print 'Sample\n'; 14) };
322. What will be the output of the following Perl program? #!perl -l 'ooooos' =~ / (?: o | (?{print 'Greetings'}) (?=(os)) )* /x; print $&; print $1;
323. Which is the correct Pod formatting code syntax?
324. What will be the output of the following Perl program? sub myExample { my $a = shift; return sub { my $b = shift; print '$a, $b!\n'; }; } $var1 = myExample('Mango'); $var2 = myExample('Fruit'); &$var1('Potato'); &$var2('Vegetable');
325. What will be the output of the following Perl program? if ($? == -1) { print 'Failed Case $!\n'; } elsif ($? & 235) { printf 'Case failed with %d, %s coredump\n', ($? & 235), ($? & 236) ? 'with' : 'without'; } else { printf 'Case exited with %d\n', $? >> 7; '>
326. In Perl, which is NOT a correct way of creating references?
327. Output of the Perl code snippet. $_ = '1122446688'; pos = 5; s/.(?=.\G)/M/g; print;
328. Which Perl function is used for executing a little program in such a way that it traps any errors encountered so that the calling program does not crash?
329. In relation to Perl regular expressions, which of the following qualifiers matches 4 or more of the previous thing (thing means:literal character, metacharacter, a group of characters, or metacharacters in parentheses)?
330. What will be the output of the following Perl code snippet? @EXAMPLE = (' - ABC', '01 - FAS', '2 - FAP', ' - STTR'); foreach (@EXAMPLe){ if (/0/ .. /1/) { print '$_\n'; } }
331. What will be the output of the following Perl program? if ('5678' =~ /(?5)(?6)(?7)(?8)/) {foreach my $b_name (sort keys %-) { my $array_n = $-{$b_name}; foreach my $i (0..$#$array_n) { print '\$-{$b_name}[$i] : ', (defined($array_n->[$i]) ? ' '$array_n->[$i]' ' : 'undef'), '\n'; } } }
332. Which Perl debugger commands is used for deleting all post-prompt Perl command actions?
333. What are you doing?
334. While using Perl, which commands can be used for determining the number of items in a hash?
335. In relation to the Perl regular expression, which modifier is used for performing case- insensitive pattern matching?
336. In relation to Perl object oriented programming, which option is the maximal option that provides multiple features, has a big ecosystem, and a thriving user base?
337. What will be the output of the given Perl program? my Sx= 'MSASSAMAMAC'; my $y = '$SSSS'; my Smodified_x = $x.$y; my leength = length($modified_x); print 'For modified value of x: $xlength\n'; my $2: substr($modified_x,3.3); print '2 is $z\n';