Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Command line arguments in Perl are stored in a a. scalar b. resource c. array

ID: 3750653 • Letter: 1

Question

1. Command line arguments in Perl are stored in a

a.

scalar

b.

resource

c.

array

d.

hash

2. Elements of a split line can be glued together with

a.

combine

b.

join

c.

push

d.

shift

3. Which of the following is used in Perl?

a.

else if

b.

elseif

c.

elsif

d.

elif

4. The last character of a line in Perl is removed by

chop

chomp

Either a or b

None of the above

5. The shift function

adds elements to a list to the left

removes elements from a list to the left

adds elements to a list to the right

removes elements from a list to the right

a.

chop

b.

chomp

c.

Either a or b

d.

None of the above

Explanation / Answer

1. c. array
The array @ARGV contains the command-line arguments
2. b.join
3. c.elsif
4. c.Either a or b
Chomp ONLY removes new line characters.
Chop removes anything that is at the end of the string.
5. b. removes elements from a list to the left
Removes and return the first element from an array. It reduces the number of elements by one

Let me know if you have any queries or clarifications.... :)