0

programming languages Online Quiz - 218

Description: programming languages Online Quiz - 218
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

Which function can be used to break up a string into more than one part based upon a separator?

  1. chop

  2. split

  3. divide

  4. parse


Correct Option: B

Your script has just read in a variable from the keyboard and you want to strip that variable of the newline character that came in. What operator should you use to perform this operation?

  1. tidy

  2. trim

  3. chomp

  4. slim


Correct Option: C

Which file test can be done to see if a file is a symbolic link?

  1. -s

  2. -l

  3. -S

  4. -k


Correct Option: B

Which file test can be done to see if a file exists and has a nonzero size?

  1. -s

  2. -l

  3. -S

  4. -k


Correct Option: A

Within Perl, which operator is used to change the working directory?

  1. cd

  2. chdir

  3. pwd

  4. wd


Correct Option: B

What is the value of @list at the end of the following program? #!/usr/local/bin/perl @list=(1,2.3); &testsub(*list); Sub testsub{ Local (*sublist)[email protected]_; $sublist[1] = 5; }

  1. (1,2.3)

  2. (1,5,3)

  3. Will produce error.

  4. (1,4,2)


Correct Option: B
  1. The code will output the following:123

  2. The code will output the following: 3

  3. The code will output the following:23

  4. The code will output the following: 321


Correct Option: A

Which line of code represents the correct syntax to establish a reference to a database handle?

  1. $dbh = DBI::connect("dbi:mysql:myPhoneBook");

  2. $dbh = DBD:->connect("dbi::mysql::myPhoneBook");

  3. $dbh = DBD::connect("mysql:dbi:myPhoneBook");

  4. $dbh = DBI->connect("dbi:mysql:myPhoneBook");


Correct Option: D
  1. Page length of a particular output file

  2. The input end-of-line character

  3. The return code returned by a command called by the system function.

  4. The error code generated by a system library routine


Correct Option: C
  1. Page length of a particular output file

  2. The input end-of-line character

  3. The return code returned by a command called by the system function.

  4. The error code generated by a system library routine.


Correct Option: D
  1. splice (@array,[email protected]);

  2. splice (@array, scalar(@array),0, @sublist);

  3. splice (@array, 1, 0, @sublist);

  4. None of Above


Correct Option: B
  1. print ("capital"=>$kansas);

  2. print {$kansas}=>(capital);

  3. print (capital)<={$kansas};

  4. print $kansas->{"capital"};


Correct Option: D
- Hide questions