Dear Readers, Welcome to Perl Scripting Objective Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your Job interview for the subject of Perl Scripting MCQs. These objective type Perl Scripting questions are very important for campus placement test and job interviews. As per my experience good interviewers hardly plan to ask any particular question during your Job interview and these model questions are asked in the online technical test and interview of many IT companies.
A. A string in double quotes
B. A MySQL select statement
C. A regular expression
D. A template
Ans: C
A. A type of interactive web page
B. A programming language
C. An application program
D. A relational database
Ans: B
A. At least six columns wide in total, with two figures after the decimal place
B. Exactly six digits before the decimal place, and two digits after
C. At least six digits before the decimal place, and two digits after
D. Exactly six columns wide in total, with two figures after the decimal place
Ans: A
A. opens the file abc.txt for overwriting
B. opens the file abc.txt for reading
C. contains an error, so won't compile
D. opens the file abc.txt for appending
Ans: B
A. 1
B. You may not make any assumption
C. The boolean value "false"
D. A null string (or 0 arithmetically)
Ans: D
A. Curly braces
B. Square brackets
C. Round brackets
D. You don't use brackets in Perl - you write in RPN (Reverse Polish Notation)
Ans: C
A. if ($qn =~ /perl/) .....
B. if ($qn == "perl") ....
C. if ($qn = "perl") .....
D. if ($qn eq "perl") .....
Ans: B
A. Perl, legally, for free
B. Individual and site licenses
C. Full documentation of the language which you can print out yourself
D. A Carribean cruise in 2006 on which you can meet some of the Perl gurus.
Ans: C
A. 1978
B. 1998
C. Perl hasn't yet been released
D. 1988
Ans: D
58% on 4261 times asked
my $val = 'x';
print ref($val);
A. SCALAR
B. empty value
C. STRING
D. "not a reference"
Ans: B
A. Reading binary data from a file into a scalar variable
B. Finding where a file is on the disc
C. Accessing a disc file or other input/output stream
D. Deleting, moving or renaming a file
Ans: A
A. The larger of two numbers e.g. 200 % 20 would return 200
B. A percentage of a number e.g. 200 % 20 would return 40
C. The remainder when one number is divided by another
D. The remainder when one number is divided by another e.g. 18 % 7 would return 5
Ans: C
A. Practical Extraction and Report Language
B. Practice for Exclusive and Report Language
C. Practical Extraction and Report Learning
D. Practical Exclusive and Report Language
Ans: A
A. else if
B. elseif
C. elsif
D. elif
Ans: C
A. holds the last pattern matched.
B. holds the output field separator.
C. identifies the current command line argument.
D. none of the above is correct.
Ans: D
A. Reads a single file name from an open directory handle.
B. Reads the rest of the file names from an open directory handle.
C. Only works after anopendir command.
D. Is not a perl command.
Ans: D
A. is 10.
B. is true.
C. cannot be determined from the information given.
D. relies on which command line arguments were used.
Ans: C
A. assigns$y[4] to $x.
B. assigns$y[2] to $x.
C. assigns 3 to$x.
Ans: B
A. @a = split($str).
B. @a = split(/\s/, $str).
C. This task can be done in Perl but none of the above commands do it.
Ans: C
A. more than one of the above is correct.
B. identifies any command line arguments starting with a-.
C. will read the standard input if no arguments are listed on the command line.
D. can be used to read each line in every file name listed on the command line.
Ans: A
a) character class
b) metacharacter
c) assertion
d) quantifier
Ans: d
a) You won $5.00
b) You won 5 dollars
c) You won $prize
d) You won $5
Ans: c
a) True
b) False
Ans: a
a) stdquit
b) stdend
c) stdin
d) stdout
e) C&D
Ans: e
a) -P
b) -W
c) -p
d) -w
Ans: d
a) Perl version ID
b) Web server ID
c) Last access
d) Inode number
e) C&E
Ans: e
a) True
b) False
Ans: b
a) #
b) @
c) %
d) $
Ans: d
my $val = {};
print ref($val);
A. empty value
B. ARRAY
C. HASH
D. SCALAR
E. True
Ans: C
my @a = (0, 1, 2);
my $b = @a;
print $b;
A. 0
B. 1
C. 2
D. 3
E. 0 1 2
Ans: D
A. Hello world
This is Perl
B. Hello
world
This is Perl
C. Hello
World This is Perl
D. Hello
world\n\nThis is Perl
Ans: C
A. $a contains "This is Perl"; $b contains "This is Perl\n"
B. $a contains "This is Per"; $b contains "This is Perl\n"
C. $a contains "This is Perl"; $b contains "This is Perl"
D. $a contains "This is Perl\n"; $b contains "This is Perl\n"
Ans: A
A. "Hello world"
B. "Helloworld"
C. "Hello"
D. "world"
Ans: D
A. Perl
B. Java
C. C++
D. Java, Perl, and C++ are equally good for the job.
Ans: C
A. A Python compiler
B. A Python editor
C. A Python virtual machine
D. A Python interpreter
Ans: D