See [ importance_0498.html ] for a discussion of the importance of Perl.
Perl is a dynamically scoped, block structured language. It uses special characters ($,@,%,&) to distinguish different types of data(scalar, array,associative array, subprogram).
PERL on Windows
Question From Alumin (Anonimized)
$var = whateveris ok in Perl, but abnormal in 'sh'.
b word boundary (between \w and \W)
B non-word boudary.
d decimal digit [0-9]
D non-digit
w word-character [0-9a-z_A-z]
W non-word character
s whitespace [ \t\n\r\f]
S non-whitespace character.
$| -- indicates buffering of file, set to 1 to force I/O on each command.
$%, $=, $-, $~, $^ -- used in page and column lay out for reports
$1 .. $9 -- Parts of matched patterns in parentheses
$& -- the last pattern matched
$`,$&,$' -- Before match, match, after match
$$ -- UNIX Process Id
$? -- status report form pipe, sub-shell, etc
$* -- set to 1 to do multiline matches, 0 for efficient one line matching
$/ -- end of input record separator, set to "" to treat paragraphs as a record.
$0 -- name of perl script
$[ -- base of arrays, defaults to 0.
$; -- separates dimensions in multidimensional index
$! -- error number
$@ -- Perl eror message
$<, $>,$(, $) -- user and group ids on UNIX
$: -- Characters after which a string can word wrapped for preference
$#A -- number of scalars in array @A
ARGV -- Command line arguments
<ARGV> -- file_handle that becomes each argument in turn
$ARGV -- Current <ARGV>
@ARGV -- array of arguments
%ENV -- environment handed to perl program by operating system.
STDERR -- Standard error output
STDIN -- Standard input
STDOUT -- Standard output
(math): atan2(x,y), cos(r), exp(x), log (base e), rand(expr)(in 0..(_)), sin(r), sqrt, srand,
. any single character except end of line
* any number of previous including none
+ one or more of the previous
? zero or one of the previous ("optional" -- compare $O)
[abc] One of the listed elements
[^ab] one of the unlisted elements
...
sub foo{
local($x,$y,$z)=@_;
...
}
$example = << 'ENDIT';
Even the longest string
must end it somewhere.
ENDITEach line can contain variables that are interpretted and placed in the string. This is very handy for form letters...
Modules
Files and directories form a module hierarchy as of Perl 5
(a bit like Java here!) with
the C++ double-colon symbol:
directory::file
Objects and Structures
Added in Perl 5 and very incomplete.
$variable={}; -- assign empty object
$variable->{FIELD}; -- access field/method...
. . . . . . . . . ( end of section Syntax) <<Contents | End>>
Glossary
perldoc perl
(Camel): Larry Wall & Randal L Schwartz, Programming perl, O'Reilly & Associates (Nutshell
book).
(FAQ):
//ftp.flirble.org/pub/languages/perl/CPAN/doc/manual/html/pod/perlfaq.html
(reference_on_WWW):
[ http://reference.perl.com/ ]
(smith99): B. Smith <BCS@DNAI.COM >posted the following on comp.software_eng
in April 1999:
(archives):
[ CPAN.html ]
(CPAN archive, comprehesive collection of Perl programs and modules
including most recent versions of Perl itself)
comp.lang.perl.miscso don't forget to try this command
perldoc perlto see if your system has the documentation and then (the newsgroup archive), [ http://www.dejanews.com/ ] to search to see if your question/problem has already been addressed, or at least get some backround. Then ask your question at //comp.lang.perl.misc
. . . . . . . . . ( end of section Notes on Perl) <<Contents | End>>