Perl

 38 Minutes
 19 Questions


This test is designed to assess a candidate's knowledge of the Perl programming language. It will cover topics such as basic syntax, files and I/O, and regular expressions. The test will include questions on how to write code in Perl, how to read and write files, and how to use regular expressions to search for patterns in strings. Candidates should be familiar with the fundamentals of the language as well as more advanced concepts.


Example Question:

Multiple-Choice
What will be the output of the following code
#!/usr/bin/env perl
use warnings;
use strict;
use Data::Dumper;
sub shouldBeRemoved{
if ($_[0] eq "apple"){
return 0;
}
return 1;
}
my %fruits = (
"apple" => "1Kg",
"orange" => "2Kg",
"grape" => "3Kg",
);
foreach my $key (keys %fruits) {
if (shouldBeRemoved($key)) {
delete($fruits{$key});
}
}
print Dumper(\%fruits);