E-book ch: 12 Perl Flashcards

1
Q

Scalars are what?

A

a number, character or string that represents a Single Value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does PERL mean?

A

PERL: Practical Extraction and Report Language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how do perl statements end?

A

with a semicolon ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is a Variable?

A

identifies the file location in memory where the scalar (single value that is a number/character string) is stored.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how do you write a variable in perl?

A

$TheVariableNameDeclaired

($) sign before the variable name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is the string quote that uses ‘ apostrophe?

A

’ = text placed between (‘ ‘) is interpreted exactly as shown.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is the string quote that uses a set of” “

A

” “= double quotes are used to show that these coded variables are substituted by values stored inside them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is the string quote that uses a set of ` ` back ticks?

A

` ` = backtick is used to have text evaluated separately. output of quoted command substitutes the quoted code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is an inbuilt function?

A

words built into perl that when used in the code they perform a specific function like: chop = removes the last character of a string. *often functions are followed by arguments, arguments,

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
what is this an example of in perl.. list each part of sample code:
#!usr1/folder/perl
$count= 1;
while ($count<10) [print"this text", $count;
A
#!usr1/folder/perl [pound sign &amp; ! comment marker &amp;path (location)of the perl interpreter.]
$count= 1;  [$ used to set variable location in memory]
= {assignment operator}
1 {scalar or value of count}
while ($count<10) [print"this text", $count; {the part in () is the argument.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what do the following functions do?
sort(LIST)
reverse(LIST)
join(EXPR, LIST)

A

FUNCTION TASK

        sort(LIST)                              return a new list that is the sorted form of LIST

        reverse(LIST)                         return a new list that is the opposite order of LIST

        join(EXPR, LIST)                   gives a string of LIST items joined by EXPR
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

\n means what in perl?

A

\n new line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is an Array?

A

a named list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

an array called:
@_
contains what?

A

arguments to a subroutine are contained in this array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are the 2 sets of operators used for comparing values in perl?

A

string operators and
number operators
string: eq
number: ==

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what are Repetition statements?

A

also called looping/ iteration:

diff. data can be processed using the same group of statements.

17
Q

what are the 4 Repetition Statements?

A

do, while, for, foreach

18
Q

what do Files do in Perl?

A

allow flow of data to a program from and external medium (4 functions:) open, close, print and <>

19
Q

what is a CGI script?

A

CGI: Common Gateway Interface- how info is passed from browser to server.