-
- Weitere Informationen zu diesem Buch:
Inhaltsverzeichnis | Index | Probekapitel | Kolophon | Rezensionen |
Beispiele |
- Weitere Informationen zu diesem Buch:
Second Edition August 2003
ISBN 978-0-596-00313-5
Weitere Informationen zu diesem Buch
Inhaltsverzeichnis |
Index |
Probekapitel |
Kolophon |
Rezensionen |
Beispiele |
Index
[ Symbols ], [ Numbers ], [ A ], [ B ], [ C ], [ D ], [ E ], [ F ], [ G ], [ H ], [ I ], [ J ], [ K ], [ L ], [ M ], [ N ], [ O ], [ P ], [ Q ], [ R ], [ S ], [ T ], [ U ], [ V ], [ W ], [ X ], [ Y ], [ Z ]
Symbols[ Top ]
<&= and <& open modes, 262
@_ array, 374
-> (arrow) operator, 408
||= (assignment) operator, 10
* (asterisk)
mail headers, 750
storing filehandles, 255-258
@ (at sign)
references to arrays, 413
splice( ), 134
\ (backslash)
comments in regular expressions, 190
creating arrays, 421
creating references, 409
escaping characters, 41
references to arrays, 414
references to scalars, 420
` (backtick)
expanding, 34
gathering program output, 630
operator, 780
: (colon)
mail headers, 750
module names, 446
package names, 444
, (comma)
in numbers, 84
printing lists with, 113-114
$ (dollar sign)
hashes, 150
. (dot)
. . and . . . (range) operators, 199
period in numbers, 84
" (double quote), 2
escaping, 568
/ (forward slash)
root directory, 346
-> (infix) notation, 408
< (left angle bracket)
access mode, 245
- (minus)
modifiers and, 224
<=> numerical comparison operator, 138
&& operator, 10
-> operator, 501
=> operator, 151
=~ operator, 8
|| operator
or operator vs., 12
separating multiple comparisons, 140
% (percent sign)
hashes, 150
# (pound sign)
with printf( ), 84
> (right angle bracket)
access mode, 245
' (single quote), 2
escaping, 568
~ (tilde)
in filenames, expanding, 253
_ (underscore)
file stat cache, 348
$/ variable, 302
$; variable, 356
$_ variable
accidental clobbering, 121
outlawing unauthorized use, 543-545
$| variable, 247, 281
< > (angle brackets), 3
globbing, 358
line input operator, 270
reading string from binary file, 324
TCP, communicating over, 686
{ } (curly braces), 3
{ } curly braces
creating references, 409
[ ] (square brackets), 3
[ ] square brackets
creating references, 409
( ) (parentheses), 3
autouse pragma, 455
comments in regular expressions, 191
prototyping functions, 389
substitution, 185
Numbers[ Top ]
-0 command-line option, 302
$1, $2, . . . (backreferences), 184
finding doubled words, 215
A[ Top ]
-a command-line option
writing filters, 272
"a" for terminal bell, 598
abbrev( ), 227
abbreviations, matching, 226-228
accept( ), 685
access log, 767
access to database (see database access)
access_log files:access log, 823
addresses, email, matching, 224
adist( ), 51
advisory locking, 279
alarm, ringing, 598
alarm( ), 104, 670
Alias module, 513
aliases
for filehandles, 263-265
for functions, 397
for list elements, 121
American Standard Code for Information Interchange (see ASCII)
AND functionality in regular expressions, 220-224
angle brackets (< >), 3, 358
line input operator, 270
reading string from binary file, 324
TCP, communicating over, 686
angles
in degrees vs. radians, 76
anonymous data, 409
Apache web server
code handlers, ??-843
handlers, 841-??
phases of request-response transaction, 843
(see also mod_perl)
Apache::Cookie module, 847
accessing values, 849
Apache;log files, 823
Apache::PerlRun module, 841
Apache::Registry module, 841
appendhash_demo program, 545
appending arrays to each other, 130
approximate matching, 209
arguments, subroutine, 374-376
function prototypes, 388-391
passing by named parameter, 383
passing by reference, 381
ARGV line input operator, 245
ARGV, magic (see magic open)
arithmetic
complex (imaginary) numbers, 82
matrix multiplication, 80-81
$#ARRAY variable, 115
arrays, 110-149
anonymous, 409
appending multiple, 130
changing size of, 115-116
circular, 143
extracting
particular elements, 124-125
particular subsets, 136
hashes of, 415
initializing, 111
with comma-separated values, 111
iterating
over by reference, 122
through all elements, 119-122, 134-136
last valid index ($#ARRAY), 115
lists vs., 110
matrix multiplication, 80-81
multidimensional, 111
of scalar references, 421
permute program, 146-149
printing elements with commas, 113-114
processing multiple elements, 132
randomizing, 144
randomly selecting from, 71
reading files backwards, 310-312
references to, 413-415
reversing elements of, 131
sorting
by computable field, 139-143
elements numerically, 138
sparse, implementing, 117-119
treating files as, 331
unions, intersections, differences, 126
words program, 144-146
arrow (->) operator, 408
ASCII (American Standard Code for Information Interchange), 4
ASCII characters (see characters)
assignment (||=) operator, 10
assignment, list, 13
associate arrays (see hashes)
asterisk (*)
mail headers, 750
storing filehandles, 255-258
at sign (@)
references to arrays, 413
splice( ), 134
atime field, 347
attach( ), 749
attributes, object, 511-514
Authen::SASL module, 747
authentication
with mod_perl, 846
autoflush( ), 281, 648
AUTOLOAD
trapping undefining function calls, 399
AUTOLOAD mechanism, 503
generating methods, 531-533
AutoLoader module, 469
autouse pragma, 455
autovivification, 409
B[ Top ]
backreferences ($1, $2, . . .), 184
finding doubled words, 215
backslash (\)
comments in regular expressions, 190
creating arrays, 421
creating references, 409
escaping characters, 41
passing arrays/hashes by references, 381
references to arrays, 414
references to scalars, 420
backsniff program, 721
backtick (`)
gathering program output, 630
operator, 780
backtick (`)
expanding, 34
backtracking
finding doubled words, 217
in pattern matching, 182
bad hyperlinks, finding, 815
bake( ), 848
base class, 506
empty base class test, 528
basename( )
filenames
splitting, 365
=begin pod directive, 490
bell, ringing, 598
Berkeley DB library, 552
bgets program, 324
biased random numbers, generating, 74-76
bidirectional clients, 699-701
binary files
processing, 320
reading strings from, 324
binary numbers
converting, 83
binary tree structures, 441
binary trees program, 441
bind( )
LDAP server, 747
binding, 572
binmode( ), 304, 321
bless( ), 500, 508
blessing, 500
blocking file access, 279-281
netlock program, 291-294
reading a line from a filehandle without, 289
region-specific locks, 294-299
blocking signals, 668
blocking( ), 241
Boolean connectives in patterns, 220-224
browsers
redirecting, 785-787
B-tree implementation, 559
buffered input/output, 247, 282, 305
controlling for other programs, 643
socket programming and, 687
building
modules from CPAN, 490-493
bytes
unread, determining number of, 285-287
bytes layer, 304
C[ Top ]
-C command-line switch, 337
%c format, 14
C, writing modules in, 484-487
cacheout( ), 259
caching
open filehandles, 259
calc_new_date( ), 96
calc_new_date_time( ), 96
calculating
prime numbers, 87
caller( ), 459
names of subroutines, 380
can( ), 524
generating methods, 533
can_read( ), 290
capitalization
case-insensitive hashes, 546
converting between cases, 29
honoring locale when matching, 207
of titles/headlines, 31-33
Carp module, 474
carriage returns (see line breaks; whitespace)
cascade menu entries, 611
case
honoring locale when matching, 207
case sensitivity
capitalizing titles/headlines, 31-33
converting case, 29
cbreak mode, 597
CDATA, 879
ceil( ), 65
CGI programming, 765-801
chemiserie program, 796-801
cookies, 789-791
debugging raw HTTP exchange, 787
fixing 500 server errors, 773-776
HTTP methods, 767, 770
multiscreen scripts, 792-795
performance, 841
(see also mod_perl)
redirecting browsers, 785-787
redirecting error messages, 771
saving/mailing HTML forms, 795
security and, 768, 776-779
executing user commands, 780-782
sticky widgets, 791
writing scripts, 769-771
CGI programming;improving efficiency of, 860
CGI::Carp module, 772
sending errors/warnings to browser/file, 775
CGI::Cookie module, 848
accessing cookie values, 849
CGI.pm module, 766
creating sticky widgets, 791
HTML helper functions, 782
managing cookies, 789-??, 789, ??-791
writing CGI scripts, 770
changed web pages, links in, 817
characters
converting case, 29
converting with values, 13-15
escaping, 41
matching
letters, 186-188
parsing command-line arguments, 589-591
processing individually, 17-19
reversing, 19
text color, changing, 595
characters;converting ASCII to/from HTML, 811
charnames::viacode( ), 16
charnames::vianame( ), 16
checkbutton menu entries, 610
chemiserie program, 796-801
chr( ), 14
circular data structures, 533-536
circular lists, 143
class attributes, 514-516
class data
circular data structures, 533-536
managing, 514-516
class methods, 502, 506, 514
$class variable, 520
classes, 500
accessing overridden methods, 529-531
as structs, 516-520
determining subclass membership, 525
generating methods with AUTOLOAD, 503, 531-533
inheritance, 503, 527
Class::Struct, 517
Class::Struct module, 516
cleaning up modules, 461-463
clear command, 593
clearerr( ), 312
clients
bidirectional, 699-701
FTP, 732-735
TCP, 681-683
UDP, setting up, 689-691
clobbering values, 13
cloning parent objects, 520
close( )
file locks, 280
filehandles, 246
closedir( ), 350
closing
file descriptors, 262
closures, 401, 419, 480
as objects, 423-424
cmp operator, 138
cmp( ), 138
code handlers, ??-843
code points, Unicode, 5
code size, library, 553
colon (:)
mail headers, 750
module names, 446
package names, 444
color of text, changing, 595
color( ), 595
colored( ), 595
columns
arranging du command output, 174-178
outputting text in, 144-146
parsing data by, 9
wrapping paragraphs by, 39-41
comma (,)
in numbers, 84
printing lists with, 113-114
command entry, menu items, 610
command interpreters, 42
command-line arguments
Boolean connectives in patterns, 220
command-line arguments, parsing, 589-591
comma-separated values
initializing arrays with, 111
parsing, 44-48
reading records from, 198
comments
in regular expressions, 189-192
pod documentation for modules, 488-490
commify( ), 85
commify_series program, 113
commit( )
using transactions, 575
Common Log Format standard, 824
compare( ), 338
comparing
contents of two files, 338
filehandles, 339
floating-point numbers, 67
currency, 68
hashes for keys, 169
complex numbers, 82
Comprehensive Perl Archive Network (see CPAN)
compressing tabs, 25
confess( ), 474
Config module, 658
configuration files
Boolean connectives in patterns, 220
configuration files, reading, 326
Configure event, Tk, 615
connect( )
LDAP server, 747
constant variables, 48-49
constructors, 501, 507-??, 508, ??-509
accessing overridden methods, 529-531
cloning parent objects, 520
continuation characters, reading data with, 306
conventions, xxviii-xxx
converting
binary, octal, and hexadecimal numbers, 83
character case, 29
characters and values, 13-15
date/time to/from Epoch seconds, 94-96
DBM files, 556-558
degrees and radians, 76
Microsoft files to Unicode, 336-338
numbers and Roman numerals, 70
pod into other languages, 489
shell wildcards for regular expression matching, 202
strings
between characters and values, 13-15
case of, 29
non-numeric, 59
converting;ASCII to/from HTML, 811
cookies, 789-791
accessing values
with mod_perl, 849
setting
in mod_perl, 847
copy constructors, 521-523
copy( )
files/directories, 354
copying
data structures, 431
directory trees, 369
filehandles, 263-265
files, 354
parent objects, 520
surface vs. deep copies, 431
cos( ), 78
counting lines in files, 307-309
CPAN
building/installing modules from, 490-493
registering as developer, 467
CPAN (Comprehensive Perl Archive Network), 449
CPANPLUS module, 493, 498
creating
charts, 617, 625
magic variables, 542-549
menus with Tk toolkit, 609-612
processes, 628
references to methods, 424
temporary files, 265-266
crlf layer, 304, 321
croak( ), 474
CSV files
querying with SQL, 579
saving SQL query results to, 564
ctime field, 347
Ctrl-C, catching, 665
curly braces ({ }), 3
creating references, 409
currency
comparing floating-point numbers, 68
Curses module, 605
curses toolkit, 588
customizing
warnings, 476-479
Cwd module, 471
D[ Top ]
-d file test operator, 360
daemon servers, 673, 714
data, relationships between, 173
(see also variables)
data structures
binary trees, 441
circular, copying with, using weak references, 435-438
copying, 431
outlines, 438-441
printing, 429-431
storing to disk, 432
transparently persistent, 434
_ _DATA_ _ token, 266
data types
circular data structures, 533-536
classes as structs, 516-520
database access, 551-585
converting between DBM files, 556-558
DBM files
merging, 558
sorting, 559-560
storing complex data in, 561-562
dealing with errors, 569-571
emptying DBM files, 555
ggh program, 582-585
making DBM files, 553-555
persistent data, 562-565
SQL queries, 565-568
building programmatically, 573
finding number of rows returned by, 574
formatting results of, 784
querying CSV files, 579
repeating efficiently, 571-573
saving results to Excel or CSV, 564
without database server, 580
using transactions, 575
viewing data one page at a time, 577-578
database queries
formatting results of, 784
Data::Dumper module, 429
datagram sockets, 690
Date::Calc module, 96, 99
DateCalc( ), 107
Date::DateCalc module, 92
Date::Manip module, 92, 100, 107
date/time values, 90-109
arithmetic with, 96
converting to/from Epoch seconds, 94-96
Date::DateCalc, 96, 97
Date::Manip, 102
Date::Manip module, 107
days, calculating, 99
number of days between two dates, 97
file access timestamps, 351
high-resolution timers, 103
hopdelta program, 106-109
parsing information from strings, 100
printing, 101
seconds passed since Epoch, 91
sleeps, 105
sorting mail by, 405
Time::gmtime module, 95
Time::HiRes, 103
Time::Local module, 94
Time::timelocal, 95
timing out operations, 669
today's date, 92-94
years, 91
day, month, year, hour, minute, seconds (see DMYHMS)
Day_of_week( ), 99
Day_of_Year( ), 99
days (see date/time values)
db2gdbm program, 556
DBD module, 565
DBD::CSV module, 579
DBD::SQLite module, 553, 580
DB_File module, 316, 434
sorting large DBM files, 559
DBI module, 565
DBIx::Dump module, 564
DBM files
complex data in, 561-562
converting between, 556-558
emptying, 555
GDBM files, 556
making/using, 553-555
merging, 558
sorting, 559-560
DBM libraries, 551
DB_RECNO access method, 316
dclone( ), 431, 522
debugging
CGI script errors, 767
CGI scripts, 774
raw HTTP exchange, 787
deep copies, 431
default string values, 10-12
defined operator, 10
definedness, 2, 10
deg2rad( ), 77
delaying module loading, 453-455
delete( ), 156
compared to undef( ) (example), 156
multiple hash key values, 163
deleting
clearing the screen, 593
directories and their contents, 362-363
DOS shell window, 616
emptying DBM files, 555
files, 353
last line of, 319
hash elements, 156
selected subroutine return values, 385
whitespace at string ends, 43-44
deleting;HTML tags from strings, 813
delimiters, 3
Delta_Days( ), 98
Delta_DHMS( ), 98
dequote( ), 37
dereferencing (see references)
destructors, 502, 509-511
Devel::Peek module, 436
diacritics, 21
converting case and, 30
dialog boxes with Tk toolkit, 612
DialogBox widget, Tk, 612
die function, 391
_ _DIE_ _ signal, 661
differences of lists, 126
computing, 128-130
simple/symmetric, 130
directories, 346-372
copying/moving files, 354
deleting, 362-363
deleting files, 353
multiple names for same file, 355
of modules, 463-466
parsing filenames, 365
processing all files in, 356-358
recursively, 359-361
recursively duplicating, 369
renaming files, 363
sorting contents of, 350, 370-372
timestamps, 351
directory handles, 351
dirname( )
filenames
splitting, 365
disk usage, library, 553
Distinguished Name (DN), 747
DMYHMS (day, month, year, hour, minute, seconds), 91
DMYHMS values (see date/time values)
DN (Distinguished Name), 747
DNS lookups, 729-732
do operator, 373
do( )
configuration files, reading, 327
finding number of rows returned by SQL queries, 574
documentation conventions, xxix
dollar sign ($)
hashes, 150
domains
for sockets, 679
DOS shell window, removing, 616
dot (.)
. . and . . . (range) operators, 199
periods in numbers, 84
double
words, finding, 215-218
double quote ("), 2
escaping, 568
du command, sorting output of, 174-178
Dump( ), 436
Dumpvalue module, 161
duplicate
list elements, extracting, 124-125
dutree program, 174-178
dynamic scoping, 395
E[ Top ]
-e command-line option
writing filters, 273
\E string metacharacter, 42
, 27
/e substitution modifier, 27, 183
each( ), 158
hashes
merging, 168
ordering elements of, 161
traversing, 159
eager pattern matching, 181
echo and password input, 602
editing files (see file contents)
editing input, 603
/ee substitution modifier, 27
elements of arrays (see arrays)
elements of hashes (see hashes)
email
attachments
extracting, 753
sending, 749-752
matching valid addresses, 224
random signatures, 672-677
reading with POP3, 740-742
sending, 735-737
sending HTML forms via, 795
sorting, 404-406
tracking time path of, 106-109
Email::Valid module, 226
empty base class test, 528
empty strings (""), 2
Encode module, 334
=end pod directive, 490
_ _END_ _ token, 266
environment variables
MHCONTEXTFD, 263
PERL_UNICODE, 338
Epoch (see date/time values)
error log, 767
errors
500 server in CGI scripts, fixing, 773-776
CGI scripts, 767
controlling for other programs, 644-647
database, 569-571
exceptions in subroutines, 391-393
reading STDERR from programs, 640-643
redirecting messages from CGI scripts, 771
reporting filenames in, 254
reporting like built-ins, 474-476
returning failure from subroutines, 387
trapping in require/use statements, 452
trapping undefined function calls, 399
turning signals into, 671
errors;web server error log, 825
escaping characters, 41
eval( )
in substitution, 28, 183
with require/use statement, 452
events, Tk resize, 615
Excel
saving SQL query results to, 564
exceptions
handling in subroutines, 391-393
trapping undefined function calls, 399
exclusive locks, 279
exec( )
replacing programs, 634
shell escapes, 780
exists( ), 153
multiple hash key values, 163
expanding
tabs, 25
variables in user input, 27-29
Expect, controlling programs with, 607
Expect module, 607
expn program, 761
@EXPORT array (use pragma), 450
Exporter module, 447, 449-451
exporting
to modules, 446-448
@EXPORT_OK array (use pragma), 451
@EXPORT_TAGS array (use pragma), 451
expressions
interpolating within strings, 33-35
extension modules
C, building, 487
extract_bracketed( )
matching nested patterns, 218
extracting from arrays (see arrays)
extracting URLs from HTML, 808
F[ Top ]
factorial( ), 148
failure
returning from subroutines, 387
false strings, 2
fcntl( )
return values, 387
FETCH( ), 542
fetching URLs from Perl scripts, 804
<FH> line input operator, 245, 301
FIFOs (named pipes), 652-655
file access, 239-299
access modes, 244-247
caching open filehandles, 259
copying filehandles, 263-265
copying/moving files, 354
editing files (see file contents)
filehandles, 239-242
reading a line from, without blocking, 289
filtering filename input, 270-274
command-line options, 272-274
flushing output, 281-284
locking files, 279-281
netlock program, 291-294
region-specific locks, 294-299
nonblocking I/O, 284
opening/closing file descriptors, 262
printing to multiple filehandles, 260
processing all files in directories, 356-358
recursively, 359-361
reading from multiple filehandles, 287-289
standard filehandles, 242-244
storing files in program text, 266
timestamps, 351
unread bytes, determining number of, 285-287
(see also directories; file contents)
file access modes, 249
file contents, 300-345
adding records to wtmp file, 340
comparing two files, 338
configuration files, reading, 326
continually growing files, reading, 312-314
converting Microsoft files to Unicode, 336-338
counting lines/paragraphs/records, 307-309
extracting single line, 316-318
fixed-length records, 304
reading, 325
I/O layers, 303
modifying
with -i switch, 276-277
with temporary files, 274
without temporary files, 277
processing all words in, 309
processing binary files, 320
random access
updating, 322
random access I/O, 321
random lines from, selecting, 314
randomizing line order, 315
reading
backwards, 310-312
lines with continuation characters, 306
strings from binary files, 324
reading/writing hash records to file, 428
reading/writing Unicode from filehandles, 333-336
setting default I/O layers, 333
tctee program, 341
testing for trustworthiness, 329-331
treating
files as arrays, 331
strings as files, 339
variable-length text fields, 318
viewing lastlog file information, 342
(see also directories; file access)
file descriptors, opening/closing, 262
file extensions, 448
_ _FILE_ _ symbol, 380
File::Basename module, 365
FileCache module, 259
File::chmod module, 368
File::Compare module, 338
File::Copy module, 354
File::Find module, 360
directories
removing recursively, 362
File::Glob module, 253
filehandles, 239-242
autovivified, 255
caching open filehandles, 259
comparing, 339
copying, 263-265
local, 394
nonblocking I/O, 284
passing, 394, 461
printing to multiple simultaneously, 260
reading
a line from, without blocking, 289
from many, 287-289
reading/writing Unicode from, 333-336
reporting filenames in errors, 254
seek offset, 245
standard, 242-244
storing in variables, 255-258
tied, 542-??, 548, ??-549
using filename as, 254
File::KGlob module, 203
File::LockDir module, 292
filenames
expanding tildes in, 253
filtering as input, 270-274
command-line options, 272-274
matching with patterns, 358-359
multiple, for same file, 355
parsing, 365
renaming, 363
reporting in errors, 254
sorting, 350, 370-372
unusual, opening files with, 251-252
using as filehandle, 254
File::NFSLock module, 280
fileparse( ), 366
File::Path module, 362
files
binary, 320
reading strings from, 324
comparing file contents, 338
configuration, reading, 326
creating temporary, 265-266
deleting, 353
last line of, 319
locking, 279-281
netlock program, 291-294
Microsoft
converting to Unicode, 336-338
opening, 247-251
processing all in directories, 356-358
random-access, updating, 322
storing in program text, 266
treating
as arrays, 331
treating strings as, 339
with unusual filenames, opening, 251-252
File::stat module, 313, 348
filesystem (see directories)
File::Temp module, 265
filtering filenames as input, 270-274
command-line options, 272-274
filtering output, 637
FindBin module, 465
finddepth( ), 362
finding
most common anything, 172
patterns (see pattern matching, regular expressions)
versions/descriptions of modules, ??-498
FIONREAD call, 286
firewalls, connecting through, 722-726
fixed-length records, 304
reading, 325
fixed-width records
index of
program of, 343-345
FixNum class, 539-541
fixstyle program, 52-55
flat file index program, 343-345
flattened lists, 111
floating-point numbers, 59
comparing, 67
rounding, 63-66
flock( ), 279
compared to SysV lockf( ), 281
floor( ), 65
flushing output, 281-284
fmt program, 40
fnctl( )
locking files, 281
folded_demo program, 546
fonts
Unicode, support for, 337
foodfind program, 165
=for escape pod directive, 489
foreach loop
printing to multiple filehandles, 260
renaming files, 363
traversing hashes, 158
foreach( ), 134
fork( ), 647
avoiding zombie processes, 666-668
closing sockets after, 698
forking servers, 701
nonforking servers, 705-709
preforking servers, 702-705
shell escapes, 780
(see also processes)
forms, HTML, 768
saving/emailing, 795
sticky widgets, 791
forms (HTML);submitting, 807
forward slash (/)
root directory, 346
Frame widget, Tk, 609
fresh hyperlinks, finding, 817
FTP clients, 732-735
full-screen mode, 587
functions
interpolating within strings, 33-35
methods vs., 528
private for variables, 458
references to, 417-420
types of, 8
fuzzy matching, 209
fwdport program, 722-726
G[ Top ]
G anchor, 210
/g pattern-matching modifier, 183
finding Nth matches, 192
matching where last pattern ended, 210
garbage collection, 510
circular data structures and, 533-536
gaussian_rand( ), 74
GD module, 619
GDBM file
db2gdbm program, 556
GDBM files, 552
GDBM_File module, 434
GD::Graph::* modules, 617
GD::Graph::Bars module, 625
generic classes, 506
get( ) (LWP::Simple), 804
GET method, 767, 770
gethostbyaddr( ), 696
gethostbyname( ), 696
finding IP addresses, 729
getitimer( ), 104
getline( ), 257
getopt( ), 589
GetOptions( ), 590
Getopt::Long module, 589, 590
getopts( ), 590
Getopt::Std module, 589, 590
getpeername( ), 713, 721
getprotobyname( ), 680
getsocketname( ), 721
getsockname( ), 713
GetTerminalSize( ), 594
gettimeofday( ), 103
ggh program, 582-585
glob keyword, 358
glob( ), 253
global values, saving, 393-??
globbing (see pattern matching)
gmtime( ), 92, 95, 101
Time::localtime/Time::gmtime, 92
today's date, 93
graphbox program, 625
graphical user interfaces (see GUIs)
greedy pattern matching, 181
nongreedy pattern matching vs., 212-215
grep program (Unix)
Perl rewrite of, 229
grep( )
extracting array subsets, 137
group( )
Usenet news messages, 739
GUIs (graphical user interfaces), 587
H[ Top ]
h2ph tool
translating #include files, 481-484
h2xs tool, 466
loading modules, 469
making a module with C code, 484-487
handlers, 841-??
handlers (see code handlers)
handles (see filehandles)
handling signals (see signals)
hard links, 351
hashes, 125, 150-178
adding elements to, 152, 390
anonymous, 409
arrays and, 151
as records, 412
comparing for keys, 169
counting how often something appears, 172
deleting elements of, 156
dutree program, 174-178
finding most common anything, 172
for list unions, intersections, differences, 127
initializing, 151
inverting, 164
lookups by key or value, 547
merging, 167
multiple values per key, 162
of arrays, 415
presizing, 171
printing, 160
reading/writing records to file, 428
references as elements, 170
references to, 416
representing data relationships, 173
representing relationships between data, 173
retrieving in insertion order, 161
slices of, 127
sorting elements, 166
testing for keys, 153-154
ties for, 545
traversing, 157-159
hash-list equivalence, 151
head( ) (LWP::Simple), 815
HEAD method, 767
help
documentation conventions, xxix
mod_perl documentation, 844
Perl references, xxvi-xxviii
pod documentation for modules, 488-490
sorting =head1 sections, 622-625
web references, 768
here documents, 2
indenting, 35-38
hex( ), 83
hexadecimal numbers
converting, 83
hidden( )
generating sticky hidden fields, 793
high-resolution timers, 103
history.db file, grepping, 582-585
hopdelta program, 106-109
hostnames
identifying at socket end, 695
obtaining your own, 697
HotKey module, 600
hours (see date/time values)
hpush( ), 390
HREF fields, substitutions for, 838
hrefsub program (example), 838
HTML
putting links around URLs, 228
HTML forms, 768
saving/mailing, 795
sticky widgets, 791
HTML forms;automating submission, 807
HTML shortcuts
formatting lists/tables with, 782-784
HTML;converting ASCII to/from, 811
HTML::Entities module, 811
HTML;extracting tags, 813
HTML;extracting URLs from, 808
HTML;finding stale/fresh links, 815
HTML::FormatText module, 812
HTML::LinkExtor module, 808
htmlsub program (example), 837
HTML;templates, 818
HTML;text substitutions, 837
HTTP methods, 767, 770
HTTP::Response module, 805
hyperlinks;stale/fresh, 815
I[ Top ]
-I command-line switch, 463
-i command-line option
modifying files with, 276
writing filters, 272
/i pattern-matching modifier, 182
idempotency, 767
If-Modified-Since header, 822
Image::Magick module, 618
images
adding text to, 619
thumbnailing, 618
imaginary numbers, 82
implementing
sparse arrays, 117-119
importing
from modules, 397, 446
INADDR_ANY, 683, 713
@INC array, 463
#include header, translating with h2ph, 481-484
indents (see whitespace)
indexes
fixed-width records
program of, 343-345
indices of hash elements, 151
indirect notation, 504-506
indirect object notation, 257
inet_aton( )
finding IP addresses, 729
inet_ntoa( ), 681
infix (->) notation, 408
inheritance, 503, 527
initializers (see constructors)
initializing
arrays/lists, 111
hashes, 151
modules, 461-463
Inline::C module, 487
inner( ), 401
inode structure, 347
input
comma-separated, parsing, 44-48
controlling for other programs, 643, 644-647
editing, 603
executing shell commands from, 780-782
expanding variables in, 27-29
Expect-controlled programs and, 609
extracting variable-length fields, 318
from HTML forms (see CGI programming)
line input operator, 245, 301
managing multiple streams, 718-721
parsing command-line arguments, 589-591
preprocessing, 639
random-access I/O, 321
reading from keyboard, 596
reading from other programs, 635-637
reading passwords, 602
reading records with pattern separators, 198
reading STDERR from programs, 640-643
waiting, checking for, 601
installing
modules from CPAN, 490-493
signal handlers, 660
instance data
circular data structures, 533-536
managing, 511-514
instance methods, 502, 506
int( ), 65
integers
integer truncation, 66
(see also numbers)
interactivity, testing for, 591
internationalization
localization
first week of the year, 100
Unicode, 5
Internet
protocols, 727
Internet domain sockets, 679
Internet services, 727-763
accessing LDAP server, 747
DNS lookups, 729-732
expn and vrfy programs, 761
FTP client, 732-735
mail (see email)
pinging machines, 744
remote procedure calls, 728
simulating telnet connection, 743
SOAP client, 758
SOAP server, 757
Usenet news, 738-740
XML-RPC client, 756
XML-RPC server, 755
intersections on lists, 126, 128-130
inverting hashes, 164
invocant, 501
I/O layers, 247, 283, 303
bytes, 304
crlf, 304, 321
raw, 304, 321
reading/writing Unicode from filehandles, 334
scalars, 340
setting default, 333
stdio, 247, 264
unix, 247, 283
utf8, 304
I/O operations
access modes, 244-247
buffering, 247, 282, 305, 687
controlling for other programs, 643
flushing output, 281-284
nonblocking, 284
preprocessing input, 639
random-access I/O, 321
reading/writing to other programs, 635-637
ioctl(/ ) function, 483
ioctl( ), 286
return values, 387
IO::File module
filehandles, 241
IO::Handle module, 257, 262, 289, 312
IO::Multiplex module, 718
IO::Pty module, 608
IO::Select module, 288, 645, 646
IO::Socket module, 681
closing socket after forking, 698
TCP, communicating over, 686
UDP clients/servers, 689
IO::Socket::INET class, 681
IO::Socket::UNIX module, 694
IO::Stty module, 608
IO::Tee module, 261
IP addresses
determining your own, 697
DNS lookups, 729-732
expn and vrfy programs, 761
identifying at socket end, 695
identifying socket ends, 695
multi-homed servers, 713
packed, converting to ASCII strings, 681
IPC::Open2 module, 643
IPC::Open3 module, 645
IPC::Shareable module, 656
isa( ), 525
is_numeric( ), 62
is_safe( ), 331
iterations (see arrays; lists)
iterator variables, 120
J[ Top ]
join( )
using reverse( ) with, 19
K[ Top ]
keyboard input, 596
checking for, 601
(see also input)
keys( ), 158, 169
hashes
ordering elements, 161
presizing, 171
sorting, 166
traversing, 159
kill command, 657
isting available signals, 657
sending signals, 658
L[ Top ]
\l string escape, 29
labels, menu, 610
last( ), 134
laston program, 342
lc( ), 29
lcfirst( ), 29
LDAP (Lightweight Directory Access Protocol), 747
server (see LDAP server)
LDAP server
accessing, 747
leading whitespace, removing, 43-44
left angle bracket (<)
access modes, 245
lexical scope, 377
libraries, 448
libwww-perl modules, 803
Lightweight Directory Access Protocol (see LDAP)
line breaks
extracting ranges of lines, 199-201
lines in files
counting, 307-309
deleting last, 319
randomizing order, 315
selecting random, 314
matching across multiple lines, 195-198
reading files backwards, 310-312
reading with continuation characters, 306
LINE: (implicit loop label), 273
line input operator, 245, 301
line mode interfaces, 587
_ _LINE_ _ symbol, 380
lines
counting in files, 307-309
reading files backward by, 310-312
single, extracting from file, 316-318
Lingua::EN::Inflect module, 85
links;extracting from HTML, 808
list assignment, 13
list context, detecting, 382
lists, 110-149
arrays vs., 110
circular, 143
extracting
particular elements, 124-125
particular subsets, 136
flattened, 111
formatting with HTML shortcuts, 782-784
initializing, 111
iterating
through all elements, 134-136
through elements, 119-122
permute programs, 146-149
printing with commas, 113-114
processing multiple elements, 132
randomizing element order, 144
reversing elements of, 131
sorting
by computable field, 139-143
unions, intersections, differences, 126, 128-130
words program, 144-146
List::Util module, 136, 144, 315
loading
modules, 468-470
loading modules (see modules)
local operator, 393
local( )
global values, 394
overriding signal handlers, 661
redefining functions, 397
locale settings, 207
localizing functions, 397-399
localtime( ), 92, 101
calculating days, 99
Time::localtime/Time::gmtime, 92
today's date, 93
lockarea program, 294-299
locking
blocking signals, 668
files, 279-281
netlock program, 291-294
region-specific locks, 294-299
log files (web server), 823
log files (web server);processing, 825
log( ), 79
log10( ), 79
logarithms, 78
log_base( ), 79
Logfile::Apache, 827
logical functionality in patterns, 220-224
login sessions, 588
login( )
POP3 server, 741
looks_like_number( ), 62
loop variables, 120
lowercase, converting to uppercase, 29
lst program, 370-372
lvaluable functions, 8
LWP modules, 803
LWP modules;extracting HTML tags, 813
LWP::RobotUA module, 822
LWP::Simple module, 804
LWP::Simple module;mirroring web pages, 821
LWP::UserAgent module, 805
M[ Top ]
m// operator, 8
/m pattern-matching modifier, 183
matching multiple lines, 195
magic ARGV (see magic open)
magic open, 639
magic open( ), 341
magic variables
creating, 542-549
Mail Transport Agent (see MTA)
Mail User Agents (see MUAs)
Mail::Mailer module, 735
map( ), 141
building SQL queries programmatically, 573
printing hashes, 160
matching
patterns (see pattern matching)
regular expressions (see regular expressions)
Soundex matching, 50-51
Math::BigInt module, 87
Math::Complex module, 79, 82
Math::Random module, 73
Math::Trig module, 77, 83
Math::TrulyRandom module, 73
matrix multiplication, 80-81
maximal matching
Boolean connectives in patterns, 222
quantifiers, 212
memoizing technique, 148
memory
encodings and, 335
garbage collection, 510
circular data structures and, 533-536
preallocating for hashes, 171
requirements for hash merging technique, 169
Menubutton widget, Tk, 609
merging
DBM files, 558
merging hashes, 167
meth( ), 503, 529
methods, 500, 501-503, 512
functions vs., 528
generating with AUTOLOAD, 503, 531-533
HTTP, 770
indirect notation, 504-506
invoking indirectly, 523-525
overridden, 529-531
references to, 424
remote, 757
methods, HTTP, 767
m//g operator, 309
MHCONTEXTFD environment variable, 263
MIME messages
parts of, 753
MIME (Multimedia Internet Mail Extensions), 750
MIME::Lite module, 749
MIME-Tools module, 753
minimal matching
Boolean connectives in patterns, 222
quantifiers, 212
minus (-)
modifiers and, 224
minutes (see date/time values)
mirror( ) (LWP::Simple), 821
mirroring web pages, 821
MLDBM module, 434, 553, 561
persistent data, 562
modified hyperlinks, finding, 817
modify( )
LDAP server, 749
modifying files (see file contents)
mod_perl, 841-875
authentication, 846
cookies
accessing values, 849
cookies, setting, 847
documentation, 844
mod_perl 2, 845
modules, 445
automatic setup/cleanup, 461-463
CPAN (see CPAN)
designing interface for, 449-451
directories of, 463-466
documenting with pod, 488-490
sorting =head1 sections, 622-625
finding versions/descriptions of, 495-498
importing from, 397
loading, 468-470
loading at run time, 453-455
mod_perl, 844
overriding built-in functions, 470-474
preparing for distribution, 466-468
private variables, 455-458
reporting errors like built-ins, 474-476
template for, 493
trapping errors in use/require, 452
writing functions in C, 487
writing in C, 484-487
modules;AutoLoader module, 469
months (see date/time values)
move( )
files/directories, 354
MTA (Mail Transport Agent), 741
mtime field, 347
MUAs (Mail User Agents), 735
multidimensional arrays, 111
multidimensional associative array emulation syntax, 356
multi-homed servers, 713
Multimedia Internet Mail Extensions (MIME), 750
multiple inheritance, 503
multiplication
of matrices, 80-81
multiplication;x operator, 81
mux_input( ), 718
my keyword, 376
my operator, 376
N[ Top ]
-n command-line option
writing filters, 272
n2perm( ), 148
Nagle Algorithm, 687
named pipes, 652-655
sigrand program, 672-677
names of current subroutines. determining, 379
name-value pairs
passing subroutines by named parameter, 384
natural logarithms, 79
navigation web with robots, 822
NDBM files, 552
nested HTML tags, 814
nested pattern matching, 218
nested subroutines, 400
Net::DNS module, 730, 761
Net::FTP module, 732
Net::hostent module, 520
Net::LDAP module, 747
netlock program, 291-294
Net::NNTP module, 738
Net::Ping module, 745
Net::POP3 module, 740
Netscape history.db file, 582-585
Net::SMTP module
email attachments, 751
Net::Telnet module, 743
new( )
reading from multiple filehandles, 289
new_from_fd( ), 262
newlines (see line breaks; whitespace)
NFA (non-deterministic finite automata), 182
NFC( ), 23
NFD( ), 23
NFKC( ), 23
NFKD( ), 23
noecho input mode, 602
NOFILE constant, 259
nonblocking I/O, 284
non-deterministic finite automata (see NFA)
nongreedy pattern matching, 181
greedy pattern matching vs., 212-215
non-numeric strings
converting, 59
NOT functionality in regular expressions, 220-224
nounder_demo program, 544
nstore( ), 433
numbers, 59-89
adding commas to, 84
complex (imaginary), 82
converting with characters, 13-15
decimal numbers, converting, 83
decimal places, controlling, 539-541
floating-point, 59
comparing, 67
rounding, 63-66
logarithms, 78
matrix multiplication, 80-81
octal and hexadecimal, converting, 83
operating on integer series, 68-69
plural words based on, 85-87
primes, calculating, 87
random, 60
biasing, 74-76
generating, 71-74
roman numerals, 70
scalars as, 59
strings as valid numbers, 60-63
trigonometry, 76
(see also values)
numerical comparison (<=>) operator, 138
O[ Top ]
O_ flags, 249, 284
/o pattern-matching modifier, 203-??, 203-205, ??-205
object attributes, 511-514
object methods, 506
object-oriented programming, 499, 506
objects, 500
cloning parent objects, 520
closures as, 423-424
constructing, 501, 507-509
destroying, 502, 509-511
determining subclass membership, 525
managing class data, 514-516
managing instance data, 511-514
tied objects, 542-549
oct( ), 83
octal numbers
converting, 83
octal values
working with symbolic file permissions instead, 367-368
octets, 4
treating Unicode strings as, 24
O_NONBLOCK option, 284
open, magic (see magic open)
open pragma, 333
open( )
caching open filehandles, 259
creating temporary files, 266
file access modes, 244
file descriptors
creating alias for, 264
filehandles, 248
storing in variables, 255
filtering output, 637
magic open( ), 341
reading from other programs, 635
unusual filenames, 251
(see also processes)
opendir( ), 356
globbing, 359
readdir( ), 350
opening
file descriptors, 262
files, 247-251
operators
line input, 245, 301
overloading, 536-541
OR functionality in regular expressions, 220-224
or operator
|| operator vs., 12
ord( ), 14
outer( ), 401
Outlaw $_ program, 543-545
outlines program, 438-441
output
controlling decimal places, 539-541
controlling for other programs, 643, 644-647
filtering, 637
flushing, 281-284
gathering from programs, 630
random access I/O, 321
writing to other programs, 635-637
output( ), 175
overloading operators, 536-541
overridden methods, 529-531
overriding
built-in functions, 470-474
signal handlers, 661
P[ Top ]
-p command-line option
modifying files with, 276
writing filters, 272
pack( ), 14, 322
with Tk resize events, 615
package statement, 445
_ _PACKAGE_ _ symbol, 380, 460
packages, 444
determining current calling, 459-461
overriding built-in functions, 470-474
private variables, 455-458
referring to indirectly, 479
paragraphs
counting in files, 307-309
in pod documentation, 489
reading files backwards by, 310-312
reformatting, 39-41
parameterized HTML, 818
parent classes
accessing overridden methods, 529-531
cloning objects, 520
parentheses ( ), 3
autouse pragma, 455
comments in regular expressions, 191
prototyping functions, 389
substitution, 185
parse_csv subroutines, 47
ParseDate( ), 100, 107
parsing
command-line arguments, 589-591
commas into numbers, 84
comma-separated data, 44-48
date/time from strings, 100
filenames, 365
parsing;HTML tags, 813
parsing;web server log file, 823
passing by named parameter, 383
passing by reference, subroutines, 381
passwords
randomly generating, 72
reading without echo, 602
pattern matching, 179-238
abbreviations, 226-228
across multiple lines, 195-198
backtracking, 182, 217
copying/substituting, 185
doubled words, 215-218
eager, 181
email addresses, 224
extracting ranges of lines, 199-201
filenames, 358-359
fuzzy matching, 209
greedy vs. nongreedy, 181, 212-215
history.db file, 582-585
honoring locale settings, 207
logical functionality in, 220-224
matching letters, 186-188
matching words, 188
modifiers for, 182
Boolean connectives in patterns, 224
nested patterns, 218
Nth matches, 192-195
progressive, 193
shell wildcards for, 202
tcgrep program, 229-235
testing for invalid patterns, 205-207
urlify program, 228
usefulpatterns, list of, 235-238
using /o modifier, 203-205
where last pattern ended, 210
(see also regular expressions)
pattern separators, reading data with, 198
PDL modules
matrix multiplication, 80
PDL (Perl Data Language), 80
percent sign (%)
hashes, 150
performance
presizing hashes, 171
Perl
programming conventions, xxviii-xxx
references on, xxvi-xxviii
release notes, xxv
V5.8.1, 709
Perl Data Language (see PDL)
$PERL5LIB environment variable, 465
perlmenu module, 606
PERL_UNICODE environment variable, 338
permissions
CGI scripts, 774
on libraries, 775
symbolic file, instead of octal values, 367-368
testing files for trustworthiness, 329-331
permutations, generating all possible, 146-149
permute program, 146-149
persistent
data structures, 434
database data, 562-565
private subroutine variables, 378
personal identification number (PIN), 225
PF_ constants, 679
.ph filename extension, 482
PIN (personal identification number), 225
pinging machines, 744
pipe( ), 628, 647
places( ), 539
platforms
programs/examples tested on, xxv
pluralizing words, 85-87
.pm filename extension, 446
pod
converting into other languages, 489
pod documentation, 488-490
sorting =head1 sections, 622-625
pod2html, 489
pod2man, 489
pod2text tools, 489
POE framework
writing multitasking server with, 710-712
POE::Component::Server::TCP module, 710
POP (Post Office Protocol), 741
POP server
fetching/summarizing messages on, 760
pop( )
circular lists, 143
POP3 servers, 740-742
port connection attempts, logging, 721
portability
closing filehandles, 246
Portable Operating System Interface (see POSIX)
pos( ), 211
POSIX
termios interface, 599-601
POSIX module
blocking signals, 668
today's date, 93
trigonometric functions, 78
POSIX (Portable Operating System Interface), xxvi
time( ), 91
POSIX::close( ), 263
POSIX::setsid( ), 715
POSIX::strtod( ), 62
POSIX::uname( ), 697
POST method, 767, 770, 807
Post Office Protocol (see POP)
posting Usenet messages, 738-740
pound sign (#)
with printf( ), 84
pragmas, 446
preallocating memory for hashes, 171
prime numbers
calculating, 87
print( )
email attachments, 751
outputing to multiple filehandles, 261
storing filehandles in variables, 257
TCP, communicating over, 686
printf( ), 14
floating-point numbers
rounding, 63
storing filehandles in variables, 257
printing
data structures, 429-431
date/time information, 101
hashes, 160
lists with commas, 113-114
to multiple filehandles simultaneously, 260
private
function to variable, 458
methods, 502
module variables, 455-458
subroutine variables, 376-378
(see also persistent, private subroutine variables)
processes, 627-673
catching Ctrl-C, 665
communicating between, 647-652
controlling program input/output, 643
creating, 628
filtering output, 637
gathering program output, 630
groups, 295, 659
imitating files with named pipes, 652-655
multitasking servers, writing, 709
with POE, 710-712
preprocessing input, 639
reading from/writing to programs, 635-637
reading STDERR from programs, 640-643
replacing programs, 634
running multiple programs, 632
sharing variables among, 655-657
signals, 629
blocking, 668
handlers for, 660, 662-664
listing available, 657
sending, 658
turning into errors, 671
timing out operations, 669
zombies, 628
avoiding, 666-668
processing instructions, 878
Program, 55
programs
CGI (see CGI programming)
command-line arguments, parsing, 589-591
controlling input/output of, 643
controlling with Expect, 607
filtering output, 637
gathering output from, 630
preprocessing input, 639
reading from/writing to, 635-637
reading STDERR from, 640-643
replacing, 634
running multiple, 632
simulating telnet from, 743
testing if running interactively, 591
progressive matching, 193
protocols for Internet, 727
protocols, socket, 679
prototypes, 388-391, 503
proxy, submitting forms through, 808
psgrep program, 57
example, 55-58
public methods, 502
push( ), 131, 415
circular lists, 143
Tie::IxHash module and, 162
Q[ Top ]
q// operator, 3
\Q string metacharacter, 42
qq// operator, 3
qr// operator
comments in regular expressions, 191
interpolated matches, 205
qualify_to_ref( ), 258
quote( ), 569
quotemeta( ), 42
quotes, double ("), 2
quotes, single ()', 2
quotewords( ), 46
qw( ), 111
R[ Top ]
race conditions, 778
rad2deg( ), 77
radians
degrees vs., 76
radiobuttons, 610
rand( ), 71, 314
random
email signatures, 672-677
lines in files
ordering of, 315
selecting, 314
numbers, 60
biasing, 74-76
generating, 71-74
random-access files, updating, 322
random-access I/O, 321
randomizing arrays, 144
raw layer, 304, 321
read( )
fixed-length records, 304, 325
readdir( ), 356
globbing, 359
reading files (see file access; file contents)
reading Usenet messages, 738-740
records, 412
binary tree structures, 441
closures as objects, 423-424
comma-separated (see comma-separated values)
constructing, 425-427
counting in files, 307-309
fixed-length, 304
reading, 325
lastlog file, 342
random-access I/O, 321
reading, 245
reading/writing to text files, 428
variable-length, 318
with pattern separators, reading, 198
wtmp file, 340
recursively
processing files in directories, 359-361
recv( )
TCP, communicating over, 686
redirect( ), 785
ref( ), 409, 500
references, 407-412
anonymous data, 409
arrays of scalar references, 421
as hash keys, 547
as hash values, 170
autovivification, 409
closures as objects, 423-424
hashes of arrays, 415
iterating over arrays by, 122
passing by, 381
reference count, 408
returning subroutines by, 386
self-referential structures, 533-536
symbolic, 27, 480
to arrays, 413-415
to functions, 417-420
to hashes, 416
to methods, 424
to packages, indirect, 479
to scalars, 420-??
typed, 408
weak, copying with circular data structures using, 435-438
referer, 806
Regexp::Common module, 61, 219
regular expressions
checking if strings are valid numbers, 60-63
commas in numbers, 85
commenting, 189-192
fuzzy matching, 209
honoring locale settings, 207
tcgrep program, 229-235
testing for invalid patterns, 205-207
urlify program, 228
useful, list of, 235-238
(see also pattern matching)
removing HTML tags, 813
rename script (example), 364
rename( )
modifying file with temporary file, 275
renaming files, 363
rep program, 605
Representational State Transfer (see REST)
require operator, 373
require statement, 445
trapping errors in, 452
Resize( )
thumbnailing images, 619
REST (Representational State Transfer), 728
restarting servers on demand, 716
retrieve( ), 432
retrieving URLs, 804
return context, subroutines, 382
return statement, 387
return values
subroutines
returning by reference, 386
returning failure, 387
skipping selected, 385
reverse( ), 19, 131
inverting hashes, 164
reversing
array elements, 131
words/characters in strings, 19
revhash_demo program, 547
revnum( ), 139
rewinddir( ), 358
rfrm program, 760
right angle bracket (>)
access modes, 245
rmdir( ), 363
rmtree( ), 362
robots for web traversal, 822
rollback( )
using transactions, 575
Roman module, 70
roman numerals, 70
roman( ), 70
rounding floating-point numbers, 63-66
run time
loading modules at, 453-455
run-time scoping, 395
S[ Top ]
s/// operator, 8
stripping whitespace with, 35
/s pattern-matching modifier, 183
matching multiple lines, 195
save( )
storing forms, 795
save_parameters( )
storing forms, 795
scalar multiplication operator, 81
scalar operator
list version, 385
scalars, 1
arrays of scalar references, 421
as numbers, 59
detecting scalar context, 382
exchanging values between, 12
references to, 420-??
Scalar::Util module, 62, 437
schemes, URLs, 766
scope of subroutine variables, 376
screen (see user interfaces)
scripts, 818
scripts, CGI (see CGI programming)
SDBM files, 552
search( )
LDAP server, 748
searching
for patterns (see pattern matching, regular expressions)
seconds (see date/time values)
security
CGI scripts, 768, 776-779
executing user commands, 780-782
connecting through firewalls, 722-726
testing files for trustworthiness, 329-331
security;reading passwords without echo, 602
See, 732, 787, 789, 810, 815, 823, 828
seek offset, file handles, 245
seek( ), 305, 313
seekdir( ), 358
select( ), 106
determining whether data can be read/written, 687
reading from multiple filehandles, 287, 688
SelfLoader module, 468
self-referential data structures, 533-536
send( )
TCP, communicating over, 686
sendmail program, 735
servers
daemon servers, 714
forking, 701
multi-homed, 713
multitasking, writing, 709
with POE, 710-712
nonforking, 705-709
POP3, 740-742
preforking, 702-705
restarting on demand, 716
TCP
writing, 684-686
UDP, setting up, 691-693
set theory, 126
setitimer( ), 104
setting
default I/O layers, 333
shallow copies, 431
shared locks, 279
sharing variables among processes, 655-657
shell escapes, executing commands without, 780-782
shell wildcards for regular expression matching, 202
shift( )
circular lists, 143
shopping cart applications, 792
shuffle( )
arrays, 144
lines, 315
shutdown( ), 698
%SIG hash, 660
SIGALRM signal, 629, 670
SIGCHLD signal, 629, 666
SIGHUP signal, 629, 716
SIGINT signal, 629, 665
signals, 629
blocking, 668
handlers for, 660
overriding, 661
writing, 662-664
listing available, 657
process groups, 295, 659
sending, 658
turning into fatal errors, 671
signatures, randomized, 672-677
SIGPIPE signal, 629, 636
sigprocmask syscall, 668
SIGQUIT signal, 629
sigrand program, 672-677
SIGTERM signal, 629
sigtrap pragma, 671
SIGUSR1/SIGUSR2 signals, 629
simple difference, 130
Simple Mail Transfer Protocol (see SMTP)
sin( ), 78
single inheritance, 503
single quote ('), 2
escaping, 568
size
arrays, changing, 115-116
hashes, preallocating for, 171
Tk window resize events, 615
window/terminal, determining, 594
sleep( ), 104, 105
SMTP (Simple Mail Transfer Protocol), 735
SOAP client, 758
SOAP protocol, 728
SOAP server, 757
SOAP::Lite module, 755, 758
SOCK_ constants, 679
sockaddr_in( ), 680, 690
sockaddr_un( ), 680
Unix domain sockets, 694
socket( ), 680
sockets, 679-726
bidirectional clients, 699-701
closing after forking, 698
connecting through firewalls, 722-726
daemon servers, 714
finding own name/address, 697
forking servers, 701
identifying machine at end, 695
logging port connection attempts, 721
managing multiple streams of input, 718-721
multi-homed servers, 713
nonblocking, 685
nonforking servers, 705-709
preforking servers, 702-705
servers
restarting on demand, 716
TCP protocol
communicating over, 686-689
writing clients, 681-683
writing servers, 684-686
UDP protocol
writing clients for, 689-691
writing servers for, 691-693
Unix domain, 679, 693
Some::Module package, 490
sort( ), 138
by computable field, 139
hashes, 166
sorting
array elements numerically, 138
arrays/lists by computable field, 139-143
DBM files, 559-560
directory contents, 350, 370-372
du command output, 174-178
hash elements, 166
mail, 404-406
pod =head1 sections, 622-625
randomizing array element order, 144
randomizing file line order, 315
text into columns, 144-146
Soundex matching, 50-51
soundex( ), 51
spider (robot), 822
splice( ), 132
split( ), 17
processing all words in file, 309
reading records with pattern separators, 198
using reverse( ) with, 19
variable-length text fields, 318
sprintf( ), 14
floating-point numbers
comparing, 67
rounding, 63
SQL database, 819
SQL queries
building programmatically, 573
executing using DBI, 565-568
finding number of rows returned by, 574
formatting results of, 784
querying CSV files, 579
repeating efficiently, 571-573
saving results to Excel or CSV, 564
without database server, 580
square brackets ([ ]), 3
creating refereces, 409
srand( ), 72
stale hyperlinks, finding, 815
standard filehandles, 242-244
stat( ), 329, 347
timestamps, 352
static data members, 514-516
Stat::lsMode module, 367
STDERR filehandle, 242-244
controlling for other programs, 644-647
reading from programs, 640-643
STDIN filehandle, 242-244
preprocessing input, 639
stdio layer, 247, 264
STDOUT filehandle, 242-244, 246
filtering output, 638
sticky widgets, creating, 791
Storable module, 431, 432, 522
STORE( ), 542
store( ), 432
stream sockets, 679, 701
strftime( ), 93, 102
String::Approx module, 51, 209
strings, 1-58
accessing substrings, 7-9
canonicalizing with Unicode combined characters, 22
checking if valid numbers, 60-63
converting
case, 29
characters and values, 13-15
non-numeric, 59
copying/substituting, 185
default values for, 10-12
doubled words, finding, 215-218
escaping characters, 41
hash element indices, 151
headlines/titles, capitalizing, 31-33
interpolating functions/expressions within, 33-35
matching
letters, 186-188
words, 188
numeric operators with, 538
parsing date/time information in, 100
plurals based on numbers, 85-87
processing characters individually, 17-19
psgrep program, 55-58
reading from binary files, 324
reformatting paragraphs, 39-41
removing leading/trailing spaces, 43-44
reversing elements of, 19
substituting specific words, 52-55
text color, changing, 595
treating
as files, 339
Unicode
support in Perl, 5
treating as octets, 24
treating as single characters, 21
universal character code, 4
(see also variables)
strings;converting ASCII to/from HTML, 811
strings;HTML text substitutions, 837
strings;removing/extracting HTML tags, 813
StrNum class (example), 538
struct( ), 517
struct_flock( )
lockarea program, 294
structs
classes as, 516-520
sub keyword, 373
subclasses
determining membership, 525
subject, sorting mail by, 405
submitting HTML forms, 807
subroutines, 373-406
access arguments, 374-376
built-in, overriding, 470-474
currently running, name of, 379
email sorter, 404-??, 404-406, ??-406
exception handling, 391-393
localizing, 397-399
nesting, 400
passing by named parameter, 383
passing by reference, 381
persistent private variables, 378
private for modules, 455-458
private variables, 376-378
prototypes for functions, 388-391
return context, detecting, 382
return values
returning by reference, 386
returning failure, 387
skipping selected, 385
saving global values, 393-??
trapping undefined function calls, 399
writing switch statement, 401-404
substitution
expanding filenames, 253
within strings, 185
substr( ), 7
operators to use in conjunction with, 8
pattern matching variables, 184
substrings, 7-9
SUPER pseudoclass, 529
superclasses, 503, 506
accessing overridden methods, 529-531
surface copies, 431
surl script, 817
switch construct, 401
Switch module, 401
switch statement, 786, 793
switching statement, writing, 401-404
Symbol module, 258
symbolic links, 351
duplicating directory trees, 369
to packages, 479
symbolic references, 480
Symbol::qualify( ), 460
symirror program, 369
symmetric difference, 130
syscalls, 244
Sys::Hostname module, 697
sysopen( )
filehandles, 248
nonblocking I/O, 284
unusual filenames, 251
sysread( ), 305
sysreadline( )
reading from filehandle without blocking, 289
sysseek( ), 306
Sys::Syslog module, 721
system calls (see syscalls)
system( )
executing commands without shell escapes, 780
running multiple programs, 632
shell escapes, 780
SysV IPC, 656
syswrite( ), 305
T[ Top ]
-t option, 591
tables
formatting with HTML shortcuts, 782-784
tabs (see whitespace)
tags, HTML;;(see HTML), 813
tailwtmp program, 340
taint mode, 778
tan( ), 78
tc( ), 31
tcapdemo program, 620-622
tcgrep program, 229-235
TCP protocol
communicating over, 686-689
writing clients for, 681-683
writing servers for, 684-686
TCP_NODELAY socket option, 687
tctee program, 341
tear-off menus, 611
tell( ), 305
telnet, simulating from programs, 743
tempfile( ), 265
template( ), 818
templates
for modules, 493
templates;HTML, 818
temporary files
modifying files with, 274
modifying files without, 277
Term::ANSIColor module, 595
Term::Cap module, 593, 620-622
terminal (see user interfaces)
termios interface, 599-601
Term::ReadKey module, 40
checking for waiting input, 601
determining window size, 594
reading from keyboard, 597
reading passwords, 602
Term::ReadLine module, 603
Term::ReadLine::Gnu module, 603
text
adding to images, 619
text color, 595
text editors, support for Unicode fonts, 337
text (see strings)
Text::Abbrev module, 226, 227
Text::Balanced module, 218, 219
Text::CSV module, 47
Text::CSV_File module, 47
Text::Diff module, 339
Text::Metaphone module, 50
Text::ParseWords module, 46
Text::Soundex module, 50
Text::Tabs module, 26
Text::Template module, 818
Text::Wrap module, 39-41
threads.pm, 709
tie( ), 542
DBM files
emptying, 556
making/using, 553
Tie::Array module, 543
TIEARRAY( ), 542
Tie::File module, 311, 316, 320
files as arrays, 332
Tie::Handle module, 543
TIEHANDLE( ), 542
Tie::Hash module, 543
TIEHASH( ), 542
Tie::IxHash module, 161
Tie::RefHash module, 170
Tie::Scalar module, 543
TIESCALAR( ), 542
tilde (~)
in filenames, expanding, 253
time (see date/time values)
time zones (see date/time values)
time( ), 91
high-res timers, 103
timegm( ), 92, 94
Time::gmtime module, 92, 95
Time::HiRes module, 103, 106
Time::Local module, 92, 94
timelocal( ), 92, 94
Time::localtime module, 92
timers, high-resolution, 103
timestamps, 351
Time::timelocal module, 95
Time::tm module, 92
timing out operations, 669
Tk toolkit, 588
creating menus, 609-612
dialog boxes, 612
removing DOS shell window, 616
resize events, 615
tkshufflepod program, 622-625
tkshufflepod program, 622-625
today's date, finding, 92-94
too, 839
tr/// operator, 8
converting case with, 30
trailing growing files, 312-314
trailing whitespace, removing, 43-44
trapping undefined function calls, 399
traversing hashes, 157-159
tree structures, 441
trigonometry, 77
operating in degrees vs. radians, 76
trim( ), 61
truncate( ), 305
tty devices, testing for, 592
typed referents, 408
typeglobs, 58, 255-258
assigning references to, 481
filehandles with, creating alias for, 264
global values, 396
U[ Top ]
\u string escape, 29
ualarm( ), 104
uc( ), 29
ucfirst( ), 29
UDP protocol
writing clients for, 689-691
writing servers for, 691-693
umask values, 250
uname( ), 697
unbuffered input/output, 247, 282, 305, 596
undef( )
compared to delete( ) (example), 156
undefined (undef) value, 2
underscore (_)
file stat cache, 348
Unicode, 5
character database, 16
combined characters
canonicalizing strings with, 22
converting Microsoft files to, 336-338
reading/writing from filehandles, 333-336
strings
treating as octets, 24
treating as single characters, 21
using named characters, 15
Uniform Resource Locators (see URLs)
unimport( ), 543-545
unions of lists, 126
computing, 128-130
unique list elements, extracting, 124-125
universal character code, 4
UNIVERSAL module, 524, 525
UNIVERSAL package, 525
Unix
I/O layers, 283
Unix domain sockets, 679, 693
unix layer, 247, 283
UnixDate( ), 101
unlink( )
removing directories and contents, 363
unpack( ), 7, 14
fixed-length records, 325
unread bytes, determining number of, 285-287
unshift( )
circular lists, 143
updating
random-access files, 322
uppercase, converting to lowercase, 29
URI::Heuristic, 816
URI::Heuristic module, 805
urlify program, 228
URLs (Uniform Resource Locators), 766
expanding tildes in filenames, 253
putting HTML links around, 228
URLs (Uniform Resource Locators);extracting from HTML, 808
URLs (Uniform Resource Locators);fetching from Perl scripts, 804
use bytes pragma, 24
use charnames pragma, 16
use constant pragma, 48
use locale pragma, 208
use operator, 373
use pragmas, 208, 445
trapping errors in, 452
use autouse pragma, 453-455
use lib pragma, 465
use overload pragma, 536-541
Usenet news messages, 738-740
user interfaces, 587-626
adding text to images, 619
checking for waiting input, 601
clearing the screen, 593
controlling programs with Expect, 607
determining window size, 594
dialog boxes with Tk, 612
editing input, 603
full-screen mode, 587
graphing data, 617, 625
managing screen, 604
manipulating terminal directly, 599-601
menus, creating with Tk, 609-612
multiscreen CGI scripts, 792-795
reading from keyboard, 596
reading passwords without echo, 602
removing DOS shell window, 616
ringing terminal bell, 598
tcapdemo program, 620-622
testing programs if running interactively, 591
text color, 595
thumbnailing images, 618
Tk resize events, 615
User::pwent module, 140
userstats program, 554
usleep( ), 104
UTF-8, 6, 335
utf8 layer, 304
utime( )
timestamps, 352
V[ Top ]
values
comma-separated
initializing arrays with, 111
parsing, 44-48
converting with characters, 13-15
definedness, 2, 10
exchanging between scalar variables, 12
(see also numbers; strings; variables)
values( )
traversing hashes, 159
variable-length text fields, 318
variables
constant, 48-49
expanding in user input, 27-29
filehandles in, 255-258
functions private for, 458
loop (iterator) variables, 120
magic
creating, 542-549
persistent private, for subroutines, 378
private for modules, 455-458
private, for subroutines, 376-378
scalars (see scalars)
sharing among different processes, 655-657
strings (see strings)
$VERSION variable (use pragma), 450
VERSION( ), 525
visual bell, 599
vrfy program, 761
W[ Top ]
wait( ), 667
waitpid( ), 667
wantarray( ), 382
_ _WARN_ _ signal, 661
warn( ), dialog box for, 614
warnings
customizing, 476-479
reporting like built-ins, 474-476
warnings::enabled( ), 476
warnings::register pragma, 477
wc program, 307
weaken( ), 437
WeakRef module, 437
web architecture, 765-767
web automation, 803
web automation;converting ASCII to/from HTML, 811
web automation;extracting URLs from HTML, 808
web automation;fetching URLs, 804
web automation;finding stale/fresh links, 815
web automation;HTML templates, 818
web automation;HTML text substitutions, 837
web automation;mirroring web pages, 821
web automation;parsing web server log files, 823
web automation;processing server logs, 825
web automation;removing/extracting HTML tags, 813
web automation;robots, 822
web automation;submitting HTML forms, 807
web browsers
support for Unicode fonts, 337
web forms
Boolean connectives in patterns, 220
web, references on, 768
web server logs;parsing, 823
web server logs;processing, 825
web services
SOAP client, 758
SOAP server, 757
XML-RPC server, 755
weekearly program, 323
Week_Number( ), 99
weeks (see date/time values)
weighted_rand( ), 75
while loop
G anchor, 211
traversing hashes, 157
whitespace
deleting leading/trailing, 43-44
extracting ranges of lines, 199-201
in pod documentation, 489
indenting here documents, 35-38
matching
across multiple lines, 195-198
words, 188
sorted text in columns and, 144-146
sorting du command output, 174-178
tabs, expanding/compressing, 25
whoami( ), 381
whowasi( ), 381
wildcards (shell) for regular expression matching, 202
Win32::Console module, 617
window size
determining, 483
window size, determining, 594
windows
dialog boxes, Tk, 612
DOS shell, removing, 616
words
double, finding, 215-218
fuzzy matching, 209
matching abbreviations, 226-228
pattern matching, 188
pluralizing, based on numbers, 85-87
processing all in file, 309
reversing, 19
sorting into columns, 144-146
substitutions for specific, 52-55
text color, changing, 595
wrapping paragraph text, 39-41
words program, 144-146
wrapping paragraph text, 39-41
write( ), 635
writing
signal handlers, 662-664
wtmp file, adding records to, 340
X[ Top ]
x command (Perl debugger), 429
X metacharacter, 21
x operator, 81
-X operators, 348
/x pattern modifier
comments in regular expressions, 190
/x substitution modifier, 28
XML declaration, 878
XML, processing instructions, 878
XML, Unicode encodings, 878
XML, validation, 881
XML-RPC client, 756
XML-RPC protocol, 728
XML-RPC server, 755
XMLRPC::Lite module, 756
XMLRPC::Lite modules, 728
XS interface, 466, 485
Y[ Top ]
years (see date/time values)
Z[ Top ]
zombies, 628
avoiding, 666-668
Zurück zu Perl Cookbook