Our team has conducted extensive research to compile a set of Perl MCQs. We encourage you to test your Perl knowledge by answering these multiple-choice questions provided below.
Simply scroll down to begin!
A. it contains all the list of variables defined within the script
B. It contains unix's environment variables
C. It contains all the sources of external information
D. It contains a list of directories from which Perl modules and libraries can be loaded
A. subrout args;
B. &subrout(args);
C. all are correct
D. subrout(args);
A. 2
B. 0
C. 1
D. 7
A. Passes parameters to the subrotuines
B. Shifts operators bitwise
C. Removes the first value of an array and returns its value
D. Swaps array indexes
A. %!
B. $!
C. &!
D. #!
E. @!
A. key %hash
B. scalar %hash
C. count %hash
D. keys %hash
A. Yes
B. No
A. Test
B. TEST
C. test
D. tesT
A. last call();
B. lower case
C. leastcount
D. less than
A. using &$variables;
B. including the 'use strict' pragma in your program
C. including the 'use autouse' module in your program
D. using &variables;
A. ifn (
B. fails (
C. failure (
D. unless (
A. FTP
B. Net::FTP
C. Net::SMTP
D. WWW::FTP
A. remove
B. trunc
C. chomp
D. deleol
A. shows current processid
B. The default input and pattern-searching space.
C. it display errors
D. it displays warnings
A. my @numbers = $string =~ /\S+/g;
B. my @numbers = $string =~ /\S+/e;
C. my @numbers = $string =~ /\d+/g;
D. my @numbers = $string =~ /\W+/e;
A. ;
B. nothing
C. end of line
D. .
A. Yes
B. No
A. perl -check
B. perl -C
C. perl -Check
D. perl -c
A. perl -w
B. perl -warn
C. perl -Warn
D. perl -W
A. b:a
B. a:b
C. ba
D. ab
A. the initialization (e.g., $i = 1;)
B. the condition (e.g., $i < 10;)
C. the re-initialization (e.g., $i++)
D. all are correct
A. Yes
B. No
A. Yes
B. No
A. isused $hash {'key'}
B. isexists $hash {'key'}
C. exists $hash {'key'}
D. isnull $hash {'key'}
A. $
B. *
C. %
D. &
A. 10 9 8 7 6 5 4 3 2
B. 9 9 8 7 6 5 4 3 2 1
C. 10 9 8 7 6 5 4 3 2 1
D. 9 8 7 6 5 4 3 2 1
A. within backquote
B. system ()
C. All of these
A. number of elements in hash
B. error
C. executes but blank output
D. values of only keys in hash
A. $
B. @
C. %
D. &
A. Syntax error.
B. Print nothing.
C. Print the numbers from 10 to 1.
D. Infinite loop.
E. Print the numbers from 1 to 10.
A. shows uptime
B. Change the directory to the parent of the current directory.
C. change to any directory in any level
D. Change directory to the child of the current directory.
A. STDDAT
B. STDLOG
C. STDERR
D. STDREF
A. False, the command is 'go'
B. False, the command is 'branch'
C. True
A. copy the file
B. cd cpan; install [module name]
C. cpan; install [module name]
D. install [module name]
A. 755
B. 766
C. 744
D. 776
A. sub();
B. &sub();
C. All of these
D. $some_object->sub();
A. To hide errors and warnings
B. When strict is in use and the package name is not used to fully qualify the variable, this error will be reported
C. To display warnings to the browser
D. To hide errors
A. shift
B. splice
C. push
D. chop
A. file_close fh
B. fclose fh
C. close fh
D. close $_
A. use the execute function , ie, execute("ls")
B. enclose within back ticks , ie `ls`
C. enclose within #{}, ie, #{ls}
D. use the escape function , ie escape("ls")
A. all are used for hash processing
B. each
C. delete
D. exists
A. delete $hash{'key'}
B. remove $hash{'key'}
C. empty $hash{'key'}
D. $hash{'key'}=''
A. DBI is the common interface to database where DBD is database specific driver
B. DBI is the interface to Oracle Database and DBD is the Oracle Driver
C. Both are common pipeline to hetergenous database
D. DBD is the common interface to database where DBI is database specific driver
A. Die on warnings on the program coming after it
B. Give you the version number
C. Allow you to execute an expression coming immediately after.
D. Interpret perl from standard in
A. our
B. /g
C. my
D. ~g
A. the if statement
B. the unless statement
C. both are correct
A. as the default iterator variable in a foreach loop
B. all are correct
C. by unary functions like ord and int
D. by list functions like print and unlink
A. &&=
B. .=
C. ==
D. *=
A. raise_error=0
B. raise_error=255
C. raise_error=1
D. raise_error=-1
A. 0
B. 3
C. 2
D. 1