Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Perl identifiers that hold a single value (number or string) should begin with a 1) $ 2) # 3) @ 4) % Suppose a Perl

Perl identifiers that hold a single value (number or string) should begin with a

1)

$

2)

#

3)

@

4)

%

Suppose a Perl program is started from the bash command line on a Linux system as below.

./p1.pl A B C D

Which of the following variables contains "A"?

1)

$ARGV[-1]

2)

$ARGV[0]

3)

$ARGV[1]

4)

$ARGV[2]

What is the difference between eq and =~i in Perl?

1)

eq looks for equality and =~ means pattern matching

2)

=~ looks for equality and eq means pattern matching

3)

Both operators are equivalent

4)

There is no eq operator in Perl

Perl supports matching against regular expressions.

1) True
2) False

Which of the following functions can be used to divide a string into individual tokens in Perl?

1)

convert

2)

divide

3)

split

4)

tokenize

Consider the following Perl code fragment for the next two questions.

$line = "128.78.12.9";

($p1, $p2) = split('\.', $line);

What does the variable $p1 contain after the code fragment completes execution?

1)

128

2)

78

3)

12

4)

9

What does the variable $p2 contain after the code fragment completes execution?

1)

128

2)

78

3)

12

4)

9

Perl statements must be terminated by

1)

.

2)

:

3)

$

4)

;

The Perl statement

open(FILE, $line):

1)

opens a file for appending

2)

opens a file for writing

3)

opens a file for reading

4)

opens a file for reading and writing

A while loop in Perl

1)

always executes a fixed number of times

2)

continues to iterate while the condition specified in the while statement remains false.

3)

continues to iterate while the condition specified in the while statement remains true.

4)

continues to iterate while there is a line in some file to read.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago