Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
10 Cards in this Set
- Front
- Back
- 3rd side (hint)
What does Perl stand for?
|
Practical Extraction and Report Language.
Or, Pathologically Eclectic Rubbish Lister. |
|
|
What is Perl good for?
|
Perl can be used for just about any programming task, but it is optimized for problems which deal with 90% text and 10% everything else. Compared with a high-level language such as C, Perl programs are quicker to write, read, debug and easier to maintain.
|
90% what?
|
|
What are the support sources for Perl?
|
CPAN is Comprenhensive Perl Archive Network. It is a comprehensive "one-stop shopping" for Perl (http://www.cpan.org). Also, Perl Mongers is an association of Perl groups (http://www.pm.org). A key web community for Perl is http://www.perlmonks.org. Newsgroups are also located in comp.lang.perl.*
|
|
|
What comes at the beginning of every Perl program?
|
#! /usr/bin/perl
|
|
|
What is scalar data?
|
A scalar is a simple piece of data - it can be a number, character, or a string.
|
|
|
How does Perl represent numbers and characters?
|
Internally, all numbers are treated as double-precision floating point values. Numbers can be represented literally (255.020 or 144 or -6.5e24). Perl allows underscores for clarity: 321_432_454_190. Numbers can also be represented in octal (o377), hexadecimal (0xff), and binary (0b1111111).
|
Numbers
|
|
How are strings represented literally?
|
Double-quoted string literals allow for escape characters such as newline, tab and return and for variable interpolation (variable names within quotes). Variable interpolation is also know as double-quote interpolation (p. 30).
Single-quoted string literals are a sequence of characters in single quotes with limited backslash capabilities. A ' allows for a literal quote while \\ allows for a literal backslash. |
|
|
What are string operators?
|
The . operator concatenates strings together.
The x operator is the string repetition operator; the string on the left is concatenated with the number of copies indicated on the right. |
. x
|
|
What are some differences with scalar variables in Perl and those in other languages?
|
Scalar variables in Perl are always referenced using $.
In the shell, you use $ to get the value, but leave it off to assign it a new value. In awk and C, you leave $ off entirely. |
|
|
What are the binary assignment operators in Perl?
|
They are the same as those in C or Java (ie, $fred += 5). Nearly all binary operators can be used this way (i.e., $fred **= 3), including the string concatenation operator:
$str .= ""; #same thing as $str = $str . ""; |
|