Deck 9: Perl and Cgi Programming

Full screen (f)
exit full mode
Question
In Perl,print;is equivalent to ____.

A)print "$_";
B)print "$";
C)print "_";
D)print "_$";
Use Space or
up arrow
down arrow
to flip the card.
Question
The character sequence ____ quotes all following nonalphanumeric characters until \E is encountered.

A)\u
B)\U
C)\"
D)\Q
Question
The following example shows a(n)____ variable: %animals = ('Tigers',10,'Lions',20,'Bears',30);

A)array
B)scalar
C)hash
D)string
Question
The character sequence ____ forces the next character to uppercase.

A)\u
B)\U
C)\"
D)\Q
Question
Scalar variable names begin with a(n)____.

A)dollar sign ($)
B)asterisk (*)
C)pound sign (#)
D)exclamation sign (!)
Question
The .pe extension is typically used to indicate that the file is a Perl script.
Question
If the ____ option is not included,the Awk program uses the first command-line argument as its program.

A)-I
B)-i
C)-F
D)-f
Question
The convention is to use all uppercase letters for ____.

A)variables
B)constants
C)strings
D)filehandles
Question
____ are variables that store an ordered list of scalar values that are accessed with numeric subscripts,starting at zero.

A)Strings
B)Arrays
C)Lists
D)Hashes
Question
A(n)____ is a simple variable that holds a number or a string.

A)label
B)constant
C)scalar
D)identifier
Question
Perl is a(n)____ language,which means that statements are read and immediately executed.

A)interpreted
B)object-oriented
C)compiled
D)fourth generation
Question
To refer to a single element of a hash,you use the $ character before the variable name,followed by the key associated with the value in ____.

A)parentheses
B)curly brackets
C)square brackets
D)angle brackets
Question
All complete statements in Perl end with a(n)____.

A)colon
B)semicolon
C)comma
D)asterisk
Question
When processing the individual elements of an array,use the ____ character.

A)@
B)#
C)$
D)*
Question
____ are sequences of any types of characters (including numbers that are treated as characters rather than digits).

A)Scalars
B)Strings
C)Variables
D)Constants
Question
The value of a variable can change while a program runs.
Question
Awk is popular as a CGI tool for Web-based applications.
Question
The Awk program does not require the programmer to explicitly set up looping structures as does Perl.
Question
In Perl,double-quoted strings are not subject to interpolation.
Question
A(n)____ is a variable that represents a set of key-value pairs.

A)string
B)array
C)tuple
D)hash
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
a variable in Perl
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
used to perform a line feed
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,precedes a hash variable,when it is assigned values
Question
The <> symbol is called the ____________________ operator.
Question
You can create a Web page using ____________________ (HTML).
Question
In HTML,all special codes contained inside angled brackets <> are ____.

A)commands
B)constants
C)tags
D)variables
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,when it precedes a variable name,it indicates it should not be interpolated
Question
____________________ Language (Perl)is a free script language that runs on many operating systems,including UNIX,Linux,Windows,and Mac OS X.
Question
The name of the computer at the loopback address is ____.

A)localhost
B)host
C)default
D)root
Question
After you create a Web page,you can publish the page on a Web ____.

A)program
B)database
C)server
D)client
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
marks the beginning of a comment in Perl
Question
The <=> sort operator,known as the ____________________ operator,reduces coding requirements.
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,tests two numeric values for equality
Question
____________________ are symbolic names that represent values stored in memory.
Question
The IP address ____ is the standard designation for loopback communications.

A)192.168.0.1
B)10.0.0.0
C)255.255.255.255
D)127.0.0.1
Question
In Perl,the logical OR operator is ____.

A)<>
B)<=>
C)||
D)|
Question
The ____ feature allows your UNIX or Linux system to access its own internal network configuration instead of an external network.

A)spaceship
B)loopback
C)netstat
D)ifconfig
Question
A(n)____________________ is text or an object that,when clicked,loads another document and displays it in the browser.
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
one of Perl's string relational operators
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,precedes the name of an array when assigning it values
Question
What is a compiled language?
Question
What is a Web server?
Question
What is a floating-point value?
Question
What is CGI?
Question
What are the two parts of the code of a Web (HTML)page?
Question
What is a filehandle?
Question
How can you sort @somelist and store the result in @sortedlist?
Question
Describe the types of tasks in which Perl is frequently used.
Question
What is a subroutine?
Question
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
returns the next line from a file (after it has been opened)
Question
How do you read input from the keyboard in Perl?
Question
What is a constant?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/52
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 9: Perl and Cgi Programming
1
In Perl,print;is equivalent to ____.

A)print "$_";
B)print "$";
C)print "_";
D)print "_$";
A
2
The character sequence ____ quotes all following nonalphanumeric characters until \E is encountered.

A)\u
B)\U
C)\"
D)\Q
D
3
The following example shows a(n)____ variable: %animals = ('Tigers',10,'Lions',20,'Bears',30);

A)array
B)scalar
C)hash
D)string
C
4
The character sequence ____ forces the next character to uppercase.

A)\u
B)\U
C)\"
D)\Q
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
5
Scalar variable names begin with a(n)____.

A)dollar sign ($)
B)asterisk (*)
C)pound sign (#)
D)exclamation sign (!)
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
6
The .pe extension is typically used to indicate that the file is a Perl script.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
7
If the ____ option is not included,the Awk program uses the first command-line argument as its program.

A)-I
B)-i
C)-F
D)-f
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
8
The convention is to use all uppercase letters for ____.

A)variables
B)constants
C)strings
D)filehandles
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
9
____ are variables that store an ordered list of scalar values that are accessed with numeric subscripts,starting at zero.

A)Strings
B)Arrays
C)Lists
D)Hashes
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
10
A(n)____ is a simple variable that holds a number or a string.

A)label
B)constant
C)scalar
D)identifier
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
11
Perl is a(n)____ language,which means that statements are read and immediately executed.

A)interpreted
B)object-oriented
C)compiled
D)fourth generation
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
12
To refer to a single element of a hash,you use the $ character before the variable name,followed by the key associated with the value in ____.

A)parentheses
B)curly brackets
C)square brackets
D)angle brackets
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
13
All complete statements in Perl end with a(n)____.

A)colon
B)semicolon
C)comma
D)asterisk
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
14
When processing the individual elements of an array,use the ____ character.

A)@
B)#
C)$
D)*
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
15
____ are sequences of any types of characters (including numbers that are treated as characters rather than digits).

A)Scalars
B)Strings
C)Variables
D)Constants
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
16
The value of a variable can change while a program runs.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
17
Awk is popular as a CGI tool for Web-based applications.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
18
The Awk program does not require the programmer to explicitly set up looping structures as does Perl.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
19
In Perl,double-quoted strings are not subject to interpolation.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
20
A(n)____ is a variable that represents a set of key-value pairs.

A)string
B)array
C)tuple
D)hash
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
21
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
a variable in Perl
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
22
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
used to perform a line feed
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
23
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,precedes a hash variable,when it is assigned values
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
24
The <> symbol is called the ____________________ operator.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
25
You can create a Web page using ____________________ (HTML).
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
26
In HTML,all special codes contained inside angled brackets <> are ____.

A)commands
B)constants
C)tags
D)variables
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
27
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,when it precedes a variable name,it indicates it should not be interpolated
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
28
____________________ Language (Perl)is a free script language that runs on many operating systems,including UNIX,Linux,Windows,and Mac OS X.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
29
The name of the computer at the loopback address is ____.

A)localhost
B)host
C)default
D)root
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
30
After you create a Web page,you can publish the page on a Web ____.

A)program
B)database
C)server
D)client
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
31
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
marks the beginning of a comment in Perl
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
32
The <=> sort operator,known as the ____________________ operator,reduces coding requirements.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
33
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,tests two numeric values for equality
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
34
____________________ are symbolic names that represent values stored in memory.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
35
The IP address ____ is the standard designation for loopback communications.

A)192.168.0.1
B)10.0.0.0
C)255.255.255.255
D)127.0.0.1
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
36
In Perl,the logical OR operator is ____.

A)<>
B)<=>
C)||
D)|
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
37
The ____ feature allows your UNIX or Linux system to access its own internal network configuration instead of an external network.

A)spaceship
B)loopback
C)netstat
D)ifconfig
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
38
A(n)____________________ is text or an object that,when clicked,loads another document and displays it in the browser.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
39
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
one of Perl's string relational operators
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
40
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
in Perl,precedes the name of an array when assigning it values
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
41
What is a compiled language?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
42
What is a Web server?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
43
What is a floating-point value?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
44
What is CGI?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
45
What are the two parts of the code of a Web (HTML)page?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
46
What is a filehandle?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
47
How can you sort @somelist and store the result in @sortedlist?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
48
Describe the types of tasks in which Perl is frequently used.
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
49
What is a subroutine?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
50
Match each item with a statement below.
a.\n
f.#
b.$name
g.==
c.@
h.%
d.\
i.ne
e.<>
returns the next line from a file (after it has been opened)
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
51
How do you read input from the keyboard in Perl?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
52
What is a constant?
Unlock Deck
Unlock for access to all 52 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 52 flashcards in this deck.