You are on page 1of 4

Rely-on Solutions

(Corporate Training Cell)


20, Sant Nagar, East of Kailash,
www.rely-ongroup.com

PERL PROGRAMMING
POST TRAINING QUESTIONNAIRE
Name
:
Designation:
Allotted Time: 20 mins.

Max. Marks Allotted: 20

(Tick the correct answers)

For Official
Purposes
TOTAL MARKS
OBTAINED / 20
=

NOTE: 1. More than one correct answer is possible & should be


selected/marked
2. Partial answers will NOT be awarded points
1. How to view working perl version ?
a. perl
b. perl
c. perl
d. perl

-v
--v
-V
-h

2. What is the use of command "use strict"?


a. calls the strict pragma
b. checks on definition and usage of variables
c. If unsafe or ambiguous statements are used, this command
stops the execution of the script
d. all the above (a,b and c )
3. which is valid module connect to SQL Server through Perl
a.
b.
c.
d.

use ODBC
use strict
use DBI
use win32

4.

use Win32::ODBC
$database=new Win32::ODBC("DSN"[,Connect option,...]);
The above code says under windows which provides direct
access to any ODBC-compliant database including SQL Server
database products
Post-Training Assessment Sheet

a. Yes
b. No
5. If you want to add two arrays together. How would you do that?
@sumarray = (@arr1,@arr2);
a. . operator
b. X operator
c. join function
d. push function
6. select valid splicing of arrays
a. splice ARRAY, OFFSET, LENGTH, LIST
b. splice ARRAY, OFFSET, LENGTH
c. splice ARRAY, OFFSET, LIST, LENGTH
d. none of the above
7. in perl cgi program Content-type: String HTTP header defines
a.A MIME string defining the format of the content being returned
b. Checking when the information becomes invalid
c. Set the cookie passed through the string
d. invalid HTTP Header
8. Passing Information using GET method
a. The GET method sends the encoded user information appended
to the page URL itself.
b. The page and the encoded information are separated by the ?
c. The GET method is the defualt method to pass information
from a browser to the web server and it produces a long string that
appears in your browser's Location:box.
d. all the above ( a,b and c ) statements are valid
9. use Data::Dumper;
my @dates=("16/02/2014","20/01/2014","17/02/2014");
@dates =sort{join(".(split'/',$a)[2,1,0])cmp
join(".(split '/',$b)[2,1,0])}@dates;
print Dumper \@dates;
The above code print
a. To sorted wise date
b. To sorted wise month
c. To sorted wise year not month
d. none
10. if($_ = /^(\w+)\s+.*?\1$/)
Post-Training Assessment Sheet

the above condition is checking whether the given line of text is


starting and ending with same word or not
a. Yes
b. No
11. A. The use function will export a list of symbols from a module
given a few added statements inside a module
B. require Exporter; @ISA = qw(Exporter); it's provide list of
symbols ( scalar,array,hashes)
C. h2xs is a utility to create perl module
From the above select valid perl statement ?
a. A only valid
b. B only valid
c. C only valid
d. A ,B and C are valid
12. which module supports mediate mapping between DBM::Deep
objects and storage medium
a. DBM::Deep
b. DBM::Deep::Engine
c. DBM::Deep:Engine::File
d. DBM::Deep::Hash
13. use Data::Dump
open my $temp, '>', 'myhash.txt' or die $!;
print $temp Dumper $myhash;
close $temp;
The above code defines
a. To print inputfile into log file
b. To print intputfile into empty file
c. To print same format file

14. in socket program bind () function specify that


a. the port at which they will be accepting connections from
the clients.
b. bind( SOCKET, ADDRESS );
c. used by a server which does not need to know its own
address
d. all are valid
Select valid statement
Post-Training Assessment Sheet

15. select valid listen() syntax


a. listen();
b.listen(Socket);
c.listen(Socket,QueueSize);
d.listen(Socket,QueueSize,Port);
16. in socket client program , select which one is valid connect
system call.
a. connect( SOCKET, pack_sockaddr_in($port,
inet_aton($server_ip_address)))
b.connect( SOCKET, pack_sockaddr_in($port,
inet_aton($client_ip_address)))
c. connect( SOCKET,
pack_sockaddr_in(inet_aton($server_ip_address)))
d. all are invalid
17. accept() is belongs to server side or client side ?
a. server
b.client
18. How to get data base handle object using DBI module ?
a. $dsn
b. $dsh
c. $dbh
d. $dbi
19. Executing SQL query to select all the results from the
database,done using execute() API.
a. Yes
b.No
20. my $dbh = DBI->connect($dsn, $userid, $password,
{RaiseError => 1})
or die $DBI::errstr;
the above code defines that _______
a. disconnecting database
b. connecting database
c. automatic error
d. none

Post-Training Assessment Sheet

You might also like