E-book ch: 12 Perl Flashcards
(19 cards)
Scalars are what?
a number, character or string that represents a Single Value.
what does PERL mean?
PERL: Practical Extraction and Report Language
how do perl statements end?
with a semicolon ;
what is a Variable?
identifies the file location in memory where the scalar (single value that is a number/character string) is stored.
how do you write a variable in perl?
$TheVariableNameDeclaired
($) sign before the variable name
what is the string quote that uses ‘ apostrophe?
’ = text placed between (‘ ‘) is interpreted exactly as shown.
what is the string quote that uses a set of” “
” “= double quotes are used to show that these coded variables are substituted by values stored inside them
what is the string quote that uses a set of ` ` back ticks?
` ` = backtick is used to have text evaluated separately. output of quoted command substitutes the quoted code.
what is an inbuilt function?
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,
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;
#!usr1/folder/perl [pound sign & ! comment marker &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.
what do the following functions do?
sort(LIST)
reverse(LIST)
join(EXPR, LIST)
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
\n means what in perl?
\n new line
what is an Array?
a named list
an array called:
@_
contains what?
arguments to a subroutine are contained in this array.
what are the 2 sets of operators used for comparing values in perl?
string operators and
number operators
string: eq
number: ==
what are Repetition statements?
also called looping/ iteration:
diff. data can be processed using the same group of statements.
what are the 4 Repetition Statements?
do, while, for, foreach
what do Files do in Perl?
allow flow of data to a program from and external medium (4 functions:) open, close, print and <>
what is a CGI script?
CGI: Common Gateway Interface- how info is passed from browser to server.