Installing Perl 3
INSTALL 3
NAME 3
SYNOPSIS 3
DESCRIPTION 3
WARNING: This version is not binary compatible with Perl 5.004. 3
Space Requirements 3
Start with a Fresh Distribution 4
Run Configure 4
GNU-style configure 5
Extensions 5
Including locally-installed libraries 6
Examples 6
gdbm in /usr/local 6
gdbm in /usr/you 7
Installation Directories 7
Changing the installation directory 8
Creating an installable tar archive 9
Site-wide Policy settings 9
Configure-time Options 9
Threads 9
Selecting File IO mechanisms 9
1. 10
2. 10
Building a shared libperl.so Perl library 11
Malloc Issues 11
Malloc Performance Flags 12
-DNO_FANCY_MALLOC 12
-DPLAIN_MALLOC 12
Building a debugging perl 12
Other Compiler Flags 12
What if it doesn`t work? 13
Running Configure Interactively 13
Hint files 13
** WHOA THERE!!! *** 13
Changing Compilers 13
Propagating your changes to config.sh 14
config.over 14
config.h 14
cflags 14
No sh 14
Porting information 14
make depend 14
make 15
hints 15
extensions 15
locale 15
malloc duplicates 15
varargs 15
util.c 15
Solaris and SunOS dynamic loading 15
ld.so.1: ./perl: fatal: relocation error: 16
LD_LIBRARY_PATH 16
dlopen: stub interception failed 16
nm extraction 16
umask not found 16
vsprintf 16
do_aspawn 16
__inet_* errors 17
Optimizer 17
CRIPPLED_CC 17
Missing functions 17
toke.c 17
Missing dbmclose 17
Note (probably harmless): No library found for -lsomething 17
sh: ar: not found 18
db-recno failure on tests 51, 53 and 55 18
Bad arg length for semctl, is XX, should be ZZZ 18
lib/ipc_sysv........semget: No space left on device 18
Miscellaneous 18
make test 18
What if make test doesn`t work? 18
locale 15
Out of memory 19
make install 19
Installing perl under different names 19
Installed files 19
Coexistence with earlier versions of perl5 20
Maintaining completely separate versions 21
Upgrading from 5.004 to 5.005 21
Coexistence with perl4 21
cd /usr/include; h2ph *.h sys/*.h 21
installhtml ‘help 22
cd pod && make tex && (process the latex files) 22
Reporting Problems 22
DOCUMENTATION 22
AUTHOR 23
REDISTRIBUTION 23
LAST MODIFIED 23
The Perl FAQ (Frequently Asked Questions) 24
perlfaq 24
NAME 24
DESCRIPTION 24
perlfaq: Structural overview of the FAQ. 24
perlfaq1: General Questions About Perl 24
perlfaq2: Obtaining and Learning about Perl 24
perlfaq3: Programming Tools 24
perlfaq4: Data Manipulation 24
perlfaq5: Files and Formats 24
perlfaq6: Regexps 24
perlfaq7: General Perl Language Issues 24
perlfaq8: System Interaction 24
perlfaq9: Networking 24
Where to get this document 24
How to contribute to this document 24
What will happen if you mail your Perl programming problems to the authors 24
Credits 24
Author and Copyright Information 25
Bundled Distributions 25
Disclaimer 25
Changes 25
22/June/98 25
24/April/97 25
23/April/97 25
25/March/97 25
18/March/97 25
17/March/97 Version 25
Initial Release: 11/March/97 25
perlfaq1 26
NAME 26
DESCRIPTION 26
What is Perl? 26
Who supports Perl? Who develops it? Why is it free? 26
Which version of Perl should I use? 26
What are perl4 and perl5? 26
How stable is Perl? 27
Is Perl difficult to learn? 27
How does Perl compare with other languages like Java, Python, REXX, Scheme, or Tcl? 27
Can I do [task] in Perl? 27
When shouldn`t I program in Perl? 27
What`s the difference between "perl" and "Perl"? 28
Is it a Perl program or a Perl script? 28
What is a JAPH? 28
Where can I get a list of Larry Wall witticisms? 28
How can I convince my sysadmin/supervisor/employees to use version (5/5.005/Perl instead of some other language)? 28
AUTHOR AND COPYRIGHT 29
perlfaq2 30
NAME 30
DESCRIPTION 30
What machines support Perl? Where do I get it? 30
How can I get a binary version of Perl? 30
I don`t have a C compiler on my system. How can I compile perl? 30
I copied the Perl binary from one machine to another, but scripts don`t work. 30
I grabbed the sources and tried to compile but gdbm/dynamic loading/malloc/linking/... failed. How do I make it work? 30
What modules and extensions are available for Perl? What is CPAN? What does CPAN/src/... mean? 31
Is there an ISO or ANSI certified version of Perl? 31
Where can I get information on Perl? 31
What are the Perl newsgroups on USENET? Where do I post questions? 31
Where should I post source code? 32
Perl Books 32
References 33
Tutorials 33
Task-Oriented 33
Special Topics 33
Perl in Magazines 33
Perl on the Net: FTP and WWW Access 34
What mailing lists are there for perl? 34
MacPerl 34
Perl5-Porters 34
NTPerl 34
Perl-Packrats 34
Archives of comp.lang.perl.misc 34
Where can I buy a commercial version of Perl? 35
Where do I send bug reports? 35
What is perl.com? perl.org? The Perl Institute? 35
How do I learn about object-oriented Perl programming? 36
AUTHOR AND COPYRIGHT 36
perlfaq3 37
NAME 37
DESCRIPTION 37
How do I do (anything)? 37
How can I use Perl interactively? 37
Is there a Perl shell? 37
How do I debug my Perl programs? 37
How do I profile my Perl programs? 38
How do I cross-reference my Perl programs? 38
Is there a pretty-printer (formatter) for Perl? 38
Is there a ctags for Perl? 38
Where can I get Perl macros for vi? 38
Where can I get perl-mode for emacs? 39
How can I use curses with Perl? 39
How can I use X or Tk with Perl? 39
How can I generate simple menus without using CGI or Tk? 39
What is undump? 39
How can I make my Perl program run faster? 39
How can I make my Perl program take less memory? 40
Is it unsafe to return a pointer to local data? 40
How can I free an array or hash so my program shrinks? 40
How can I make my CGI script more efficient? 40
How can I hide the source for my Perl program? 41
How can I compile my Perl program into byte code or C? 41
How can I get #!perl to work on [MS-DOS,NT,...]? 42
Can I write useful perl programs on the command line? 42
Why don`t perl one-liners work on my DOS/Mac/VMS system? 42
Where can I learn about CGI or Web programming in Perl? 43
Where can I learn about object-oriented Perl programming? 43
Where can I learn about linking C with Perl? [h2xs, xsubpp] 44
I`ve read perlembed, perlguts, etc., but I can`t embed perl in 44
When I tried to run my script, I got this message. What does it 44
What`s MakeMaker? 44
AUTHOR AND COPYRIGHT 44
perlfaq4 45
NAME 45
DESCRIPTION 45
Data: Numbers 45
Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)? 45
Why isn`t my octal data interpreted correctly? 45
Does perl have a round function? What about ceil() and floor()? Trig functions? 45
How do I convert bits into ints? 46
How do I multiply matrices? 46
How do I perform an operation on a series of integers? 46
How can I output Roman numerals? 46
Why aren`t my random numbers random? 46
Data: Dates 47
How do I find the week-of-the-year/day-of-the-year? 47
How can I compare two dates and find the difference? 47
How can I take a string and turn it into epoch seconds? 47
How can I find the Julian Day? 47
Does Perl have a year 2000 problem? Is Perl Y2K compliant? 47
Data: Strings 47
How do I validate input? 47
How do I unescape a string? 48
How do I remove consecutive pairs of characters? 48
How do I expand function calls in a string? 48
How do I find matching/nesting anything? 48
How do I reverse a string? 48
How do I expand tabs in a string? 48
How do I reformat a paragraph? 48
How can I access/change the first N letters of a string? 49
How do I change the Nth occurrence of something? 49
How can I count the number of occurrences of a substring within a string? 49
How do I capitalize all the words on one line? 50
How can I split a [character] delimited string except when inside 50
How do I strip blank space from the beginning/end of a string? 50
How do I extract selected columns from a string? 51
How do I find the soundex value of a string? 51
How can I expand variables in text strings? 51
What`s wrong with always quoting "$vars"? 52
Why don`t my <<HERE documents work? 52
1. There must be no space after the << part. 52
2. There (probably) should be a semicolon at the end. 52
3. You can`t (easily) have any space in front of the tag. 52
Data: Arrays 53
What is the difference between $array[1] and @array[1]? 53
How can I extract just the unique elements of an array? 54
a) If @in is sorted, and you want @out to be sorted: 54
b) If you don`t know whether @in is sorted: 54
c) Like (b), but @in contains only small integers: 54
d) A way to do (b) without any loops or greps: 54
e) Like (d), but @in contains only small positive integers: 54
How can I tell whether a list or array contains a certain element? 54
How do I compute the difference of two arrays? How do I compute the intersection of two arrays? 55
How do I find the first array element for which a condition is true? 55
How do I handle linked lists? 55
How do I handle circular lists? 55
How do I shuffle an array randomly? 56
How do I process/modify each element of an array? 56
How do I select a random element from an array? 56
How do I permute N elements of a list? 57
How do I sort an array by (anything)? 57
How do I manipulate arrays of bits? 58
Why does defined() return true on empty arrays and hashes? 58
Data: Hashes (Associative Arrays) 58
How do I process an entire hash? 58
What happens if I add or remove keys from a hash while iterating over it? 59
How do I look up a hash element by value? 59
How can I know how many entries are in a hash? 59
How do I sort a hash (optionally by value instead of key)? 59
How can I always keep my hash sorted? 59
What`s the difference between "delete" and "undef" with hashes? 59
Why don`t my tied hashes make the defined/exists distinction? 61
How do I reset an each() operation part-way through? 61
How can I get the unique keys from two hashes? 61
How can I store a multidimensional array in a DBM file? 61
How can I make my hash remember the order I put elements into it? 61
Why does passing a subroutine an undefined element in a hash create it? 61
How can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays? 62
How can I use a reference as a hash key? 62
Data: Misc 62
How do I handle binary data correctly? 62
How do I determine whether a scalar is a number/whole/integer/float? 62
How do I keep persistent data across program calls? 63
How do I print out or copy a recursive data structure? 63
How do I define methods for every class/object? 63
How do I verify a credit card checksum? 63
AUTHOR AND COPYRIGHT 63
perlfaq5 64
NAME 64
DESCRIPTION 64
How do I flush/unbuffer an output filehandle? Why must I do this? 64
65
How do I count the number of lines in a file? 66
How do I make a temporary file name? 66
How can I manipulate fixed-record-length files? 67
67
How can I use a filehandle indirectly? 68
How can I set up a footer format to be used with write()? 70
How can I write() into a string? 70
How can I output my numbers with commas added? 70
How can I translate tildes (~) in a filename? 70
How come when I open a file read-write it wipes it out? 71
Why do I sometimes get an "Argument list too long" when I use " or trailing blanks? 72
How can I reliably rename a file? 72
How can I lock a file? 72
1 72
2 72
3 72
What can`t I just open(FH, "file.lock")? 72
I still don`t get locking. I just want to increment the number in the file. How can I do this? 73
How do I randomly update a binary file? 73
How do I get a file`s timestamp in perl? 73
How do I set a file`s timestamp in perl? 74
How do I print to more than one file at once? 74
How can I read in a file by paragraphs? 74
How can I read a single character from a file? From the keyboard? 74
How can I tell if there`s a character waiting on a filehandle? 76
How do I do a tail -f in perl? 77
How do I dup() a filehandle in Perl? 77
How do I close a file descriptor by number? 78
Why can`t I use "C:\temp\foo" in DOS paths? What doesn`t `C:\temp\foo.exe` work? 78
Why doesn`t glob("*.*") get all the files? 78
Why does Perl let me delete read-only files? Why does -i clobber protected files? Isn`t this a bug in Perl? 78
How do I select a random line from a file? 78
AUTHOR AND COPYRIGHT 78
perlfaq6 79
NAME 79
DESCRIPTION 79
How can I hope to use regular expressions without creating illegible and unmaintainable code? 79
Comments Outside the Regexp 79
Comments Inside the Regexp 79
Different Delimiters 79
I`m having trouble matching over more than one line. What`s wrong? 79
How can I pull out lines between two patterns that are themselves on different lines? 80
I put a regular expression into $/ but it didn`t work. What`s wrong? 80
How do I substitute case insensitively on the LHS, but preserving case on the RHS? 81
How can I make \w match national character sets? 82
How can I match a locale-smart version of /[a-zA-Z]/? 82
How can I quote a variable to use in a regexp? 82
What is /o really for? 82
How do I use a regular expression to strip C style comments from a file? 82
Can I use Perl regular expressions to match balanced text? 83
What does it mean that regexps are greedy? How can I get around it? 83
How do I process each word on each line? 83
How can I print out a word-frequency or line-frequency summary? 83
How can I do approximate matching? 84
How do I efficiently match many regular expressions at once? 84
Why don`t word-boundary searches with \b work for me? 85
Why does using $&, $`, or $' slow my program down? 85
What good is \G in a regular expression? 85
Are Perl regexps DFAs or NFAs? Are they POSIX compliant? 86
What`s wrong with using grep or map in a void context? 86
How can I match strings with multibyte characters? 86
AUTHOR AND COPYRIGHT 87
perlfaq7 88
NAME 88
DESCRIPTION 88
Can I get a BNF/yacc/RE for the Perl language? 88
What are all these $@%* punctuation signs, and how do I know when to use them? 88
Do I always/never have to quote my strings or use semicolons and commas? 88
How do I skip some return values? 89
How do I temporarily block warnings? 89
What`s an extension? 89
Why do Perl operators have different precedence than C operators? 89
How do I declare/create a structure? 89
How do I create a module? 90
How do I create a class? 91
How can I tell if a variable is tainted? 91
What`s a closure? 91
What is variable suicide and how can I prevent it? 92
How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regexp}? 92
Passing Variables and Functions 92
Passing Filehandles 92
Passing Regexps 93
Passing Methods 93
How do I create a static variable? 94
What`s the difference between dynamic and lexical (static) scoping? Between local() and my()? 94
How can I access a dynamic variable while a similarly named lexical is in scope? 95
What`s the difference between deep and shallow binding? 95
Why doesn`t "my($foo) = <FILE;" work right? 95
How do I redefine a builtin function, operator, or method? 96
What`s the difference between calling a function as &foo and foo()? 96
How do I create a switch or case statement? 96
How can I catch accesses to undefined variables/functions/methods? 97
Why can`t a method included in this same file be found? 98
How can I find out my current package? 98
How can I comment out a large block of perl code? 98
AUTHOR AND COPYRIGHT 98
perlfaq8 100
NAME 100
DESCRIPTION 100
How do I find out which operating system I`m running under? 100
How come exec() doesn`t return? 100
How do I do fancy stuff with the keyboard/screen/mouse? 100
Keyboard 100
Screen 100
Mouse 100
How do I print something out in color? 100
How do I read just one key without waiting for a return key? 100
How do I check whether input is ready on the keyboard? 102
How do I clear the screen? 102
How do I get the screen size? 102
How do I ask the user for a password? 103
How do I read and write the serial port? 103
lockfiles 103
open mode 103
end of line 103
flushing output 103
non-blocking input 104
How do I decode encrypted password files? 104
How do I start a process in the background? 104
STDIN, STDOUT, and STDERR are shared 104
Signals 104
Zombies 105
How do I trap control characters/signals? 105
How do I modify the shadow password file on a Unix system? 105
How do I set the time and date? 105
How can I sleep() or alarm() for under a second? 105
How can I measure time under a second? 106
How can I do an atexit() or setjmp()/longjmp()? (Exception handling) 106
Why doesn`t my sockets program work under System V (Solaris)? What does the error message "Protocol not supported" mean? 106
How can I call my system`s unique C functions from Perl? 107
Where do I get the include files to do ioctl() or syscall()? 107
Why do setuid perl scripts complain about kernel problems? 107
How can I open a pipe both to and from a command? 107
Why can`t I get the output of a command with system()? 107
How can I capture STDERR from an external command? 107
Why doesn`t open() return an error when a pipe open fails? 109
What`s wrong with using backticks in a void context? 109
How can I call backticks without shell processing? 109
Why can`t my script read from STDIN after I gave it EOF (^D on Unix, ^Z on MS-DOS)? 110
1 110
2 110
3 110
4 110
How can I convert my shell script to perl? 110
Can I use perl to run a telnet or ftp session? 110
How can I write expect in Perl? 110
Is there a way to hide perl`s command line from programs such as "ps"? 110
111
Unix 111
How do I close a process`s filehandle without waiting for it to complete? 111
How do I fork a daemon process? 111
How do I make my program run with sh and csh? 111
How do I find out if I`m running interactively or not? 111
How do I timeout a slow event? 111
How do I set CPU limits? 112
How do I avoid zombies on a Unix system? 112
How do I use an SQL database? 112
How do I make a system() exit on control-C? 112
How do I open a file without blocking? 112
How do I install a CPAN module? 112
1 110
2 110
3 110
4 110
5 112
What`s the difference between require and use? 112
How do I keep my own module/library directory? 113
How do I add the directory my program lives in to the module/library search path? 113
How do I add a directory to my include path at runtime? 113
AUTHOR AND COPYRIGHT 113
perlfaq9 114
NAME 114
DESCRIPTION 114
My CGI script runs from the command line but not the browser. (500 Server Error) 114
How can I get better error messages from a CGI program? 114
How do I remove HTML from a string? 115
How do I extract URLs? 115
How do I download a file from the user`s machine? How do I open a file on another machine? 115
How do I make a pop-up menu in HTML? 116
How do I fetch an HTML file? 116
How do I automate an HTML form submission? 116
How do I decode or create those %-encodings on the web? 116
How do I redirect to another page? 117
How do I put a password on my web pages? 117
How do I edit my .htpasswd and .htgroup files with Perl? 117
How do I make sure users can`t enter values into a form that cause my CGI script to do bad things? 117
How do I parse a mail header? 117
How do I decode a CGI form? 117
How do I check a valid mail address? 118
How do I decode a MIME/BASE64 string? 119
How do I return the user`s mail address? 119
How do I send mail? 119
How do I read mail? 120
How do I find out my hostname/domainname/IP address? 120
How do I fetch a news article or the active newsgroups? 121
How do I fetch/put an FTP file? 121
How can I do RPC in Perl? 121
AUTHOR AND COPYRIGHT 121
The Core Perl Manual 122
perl 122
NAME 122
SYNOPSIS 122
DESCRIPTION 123
Many usability enhancements 123
Simplified grammar 124
Lexical scoping 124
Arbitrarily nested data structures 124
Modularity and reusability 124
Object-oriented programming 124
Embeddable and Extensible 124
POSIX compliant 124
Package constructors and destructors 124
Multiple simultaneous DBM implementations 124
Subroutine definitions may now be autoloaded 124
Regular expression enhancements 124
Innumerable Unbundled Modules 125
Compilability 125
ENVIRONMENT 125
AUTHOR 125
FILES 125
SEE ALSO 125
DIAGNOSTICS 125
BUGS 125
NOTES 126
perl5004delta 127
NAME 127
DESCRIPTION 127
Supported Environments 127
Core Changes 127
List assignment to %ENV works 127
"Can`t locate Foo.pm in @INC" error now lists @INC 127
Compilation option: Binary compatibility with 5.003 127
$PERL5OPT environment variable 127
Limitations on -M, -m, and -T options 127
More precise warnings 127
Deprecated: Inherited AUTOLOAD for non-methods 127
Previously deprecated %OVERLOAD is no longer usable 128
Subroutine arguments created only when they`re modified 128
Group vector changeable with $) 128
Fixed parsing of $$<digit, &$<digit, etc. 128
Fixed localization of $<digit, $&, etc. 128
No resetting of $. on implicit close 128
wantarray may return undef 129
eval EXPR determines value of EXPR in scalar context 129
Changes to tainting checks 129
No glob() or <* 129
No spawning if tainted $CDPATH, $ENV, $BASH_ENV 129
No spawning if tainted $TERM doesn`t look like a terminal name 129
New Opcode module and revised Safe module 129
Embedding improvements 129
Internal change: FileHandle class based on IO::* classes 129
Internal change: PerlIO abstraction interface 130
New and changed syntax 130
$coderef-(PARAMS) 130
New and changed builtin constants 130
__PACKAGE__ 130
New and changed builtin variables 130
$^E 130
$^H 130
$^M 130
New and changed builtin functions 130
delete on slices 130
flock 130
printf and sprintf 130
keys as an lvalue 131
my() in Control Structures 131
pack() and unpack() 131
sysseek() 132
use VERSION 132
use Module VERSION LIST 132
prototype(FUNCTION) 132
srand 132
$_ as Default 132
m//gc does not reset search position on failure 132
m//x ignores whitespace before ?*+{} 132
nested sub{} closures work now 133
formats work right on changing lexicals 133
New builtin methods 133
isa(CLASS) 133
can(METHOD) 133
VERSION( [NEED] ) 133
TIEHANDLE now supported 134
TIEHANDLE classname, LIST 134
PRINT this, LIST 134
PRINTF this, LIST 134
READ this LIST 134
READLINE this 134
GETC this 135
DESTROY this 135
Malloc enhancements 135
-DPERL_EMERGENCY_SBRK 135
-DPACK_MALLOC 135
-DTWO_POT_OPTIMIZE 135
Miscellaneous efficiency enhancements 135
Support for More Operating Systems 136
Win32 136
Plan 9 136
QNX 136
AmigaOS 136
Pragmata 136
use autouse MODULE = qw(sub1 sub2 sub3) 136
use blib 136
use blib `dir' 136
use constant NAME = VALUE 136
use locale 136
use ops 137
use vmsish 137
Modules 137
Required Updates 137
Installation directories 137
Module information summary 137
Fcntl 138
IO 138
Math::Complex 138
Math::Trig 139
DB_File 139
Net::Ping 139
Object-oriented overrides for builtin operators 139
Utility Changes 139
pod2html 139
Sends converted HTML to standard output 139
xsubpp 140
void XSUBs now default to returning nothing 140
C Language API Changes 140
gv_fetchmethod and perl_call_sv 140
perl_eval_pv 140
Extended API for manipulating hashes 140
Documentation Changes 140
perldelta 140
perlfaq 140
perllocale 140
perltoot 140
perlapio 140
perlmodlib 141
perldebug 141
perlsec 141
New Diagnostics 141
"my" variable %s masks earlier declaration in same scope 141
%s argument is not a HASH element or slice 141
Allocation too large: %lx 141
Allocation too large 141
Applying %s to %s will act on scalar(%s) 141
Attempt to free nonexistent shared string 141
Attempt to use reference as lvalue in substr 141
Bareword "%s" refers to nonexistent package 142
Can`t redefine active sort subroutine %s 142
Can`t use bareword ("%s") as %s ref while "strict refs" in use 142
Cannot resolve method `%s' overloading `%s' in package `%s' 142
Constant subroutine %s redefined 142
Constant subroutine %s undefined 142
Copy method did not return a reference 142
Died 142
Exiting pseudo-block via %s 142
Identifier too long 142
Illegal character %s (carriage return) 142
Illegal switch in PERL5OPT: %s 142
Integer overflow in hex number 142
Integer overflow in octal number 142
internal error: glob failed 143
Invalid conversion in %s: "%s" 143
Invalid type in pack: `%s' 143
Invalid type in unpack: `%s' 143
Name "%s::%s" used only once: possible typo 143
Null picture in formline 143
Offset outside string 143
Out of memory! 143
Out of memory during request for %s 143
panic: frexp 143
Possible attempt to put comments in qw() list 143
Possible attempt to separate words with commas 144
Scalar value @%s{%s} better written as $%s{%s} 144
Stub found while resolving method `%s' overloading `%s' in package `%s' 144
Too late for "-T" option 144
untie attempted while %d inner references still exist 144
Unrecognized character %s 144
Unsupported function fork 144
Use of "$$<digit" to mean "${$}<digit" is deprecated 144
Value of %s can be "0"; test with defined() 145
Variable "%s" may be unavailable 145
Variable "%s" will not stay shared 145
Warning: something`s wrong 145
Ill-formed logical name |%s| in prime_env_iter 145
Got an error from DosAllocMem 145
Malformed PERLLIB_PREFIX 146
PERL_SH_DIR too long 146
Process terminated by SIG%s 146
BUGS 146
SEE ALSO 146
HISTORY 146
perldata 147
NAME 147
DESCRIPTION 147
Variable names 147
Context 148
Scalar values 148
Scalar value constructors 150
List value constructors 152
Typeglobs and Filehandles 154
perlsyn 155
NAME 155
DESCRIPTION 155
Declarations 155
Simple statements 155
Compound statements 156
Loop Control 157
For Loops 158
Foreach Loops 158
Basic BLOCKs and Switch Statements 160
Goto 162
PODs: Embedded Documentation 162
Plain Old Comments (Not!) 163
perlop 164
NAME 164
SYNOPSIS 164
DESCRIPTION 164
Terms and List Operators (Leftward) 164
The Arrow Operator 165
Auto-increment and Auto-decrement 165
Exponentiation 165
Symbolic Unary Operators 165
Binding Operators 166
Multiplicative Operators 166
Additive Operators 166
Shift Operators 166
Named Unary Operators 166
Relational Operators 167
Equality Operators 167
Bitwise And 167
Bitwise Or and Exclusive Or 168
C-style Logical And 168
C-style Logical Or 168
Range Operators 168
Conditional Operator 169
Assignment Operators 170
Comma Operator 170
List Operators (Rightward) 170
Logical Not 171
Logical And 171
Logical or and Exclusive Or 171
C Operators Missing From Perl 171
unary & 171
unary * 171
(TYPE) 171
Quote and Quote-like Operators 171
Regexp Quote-Like Operators 172
?PATTERN? 173
m/PATTERN/cgimosx 173
/PATTERN/cgimosx 173
q/STRING/ 175
`STRING' 175
qq/STRING/ 175
"STRING" 175
qr/STRING/imosx 176
qx/STRING/ 176
`STRING` 175
qw/STRING/ 177
s/PATTERN/REPLACEMENT/egimosx 177
tr/SEARCHLIST/REPLACEMENTLIST/cds 179
y/SEARCHLIST/REPLACEMENTLIST/cds 179
Gory details of parsing quoted constructs 180
Finding the end 180
Removal of backslashes before delimiters 181
Interpolation 181
<<`EOF', m`', s`'', tr///, y/// 181
`', q// 181
"", ``, qq//, qx//, 181
?RE?, /RE/, m/RE/, s/RE/foo/, 181
Interpolation of regular expressions 182
Optimization of regular expressions 182
I/O Operators 182
Constant Folding 185
Bitwise String Operators 185
Integer Arithmetic 185
Floating-point Arithmetic 186
Bigger Numbers 186
perlre 187
NAME 187
DESCRIPTION 187
i 187
m 187
s 187
x 187
Regular Expressions 187
(?#text) 190
(?:pattern) 190
(?imsx-imsx:pattern) 190
(?=pattern) 190
(?!pattern) 190
(?<=pattern) 190
(? pattern) 190
(?(condition)yes-pattern|no-pattern) 193
(?(condition)yes-pattern) 193
(?imsx-imsx) 193
Backtracking 193
Version 8 Regular Expressions 196
WARNING on \1 vs $1 197
Repeated patterns matching zero-length substring 197
Creating custom RE engines 198
SEE ALSO 199
perlrun 200
NAME 200
SYNOPSIS 200
DESCRIPTION 200
1. 200
2. 200
3. 200
#! and quoting on non-Unix systems 201
OS/2 201
MS-DOS 201
Win95/NT 201
Macintosh 201
Location of Perl 202
Switches 202
-0[digits] 202
-a 202
-c 202
-d 202
-d:foo 202
-Dletters 202
-Dnumber 202
-e commandline 203
-Fpattern 203
-h 203
-i[extension] 203
-Idirectory 205
-l[octnum] 205
-m[-]module 205
-M[-]module 205
-M[-]`module ...' 205
-[mM][-]module=arg[,arg]... 205
-n 205
-p 206
-P 206
-s 206
-S 206
-T 207
-u 207
-U 207
-v 207
-V 207
-V:name 207
-w 207
-x directory 207
ENVIRONMENT 207
HOME 207
LOGDIR 207
PATH 207
PERL5LIB 207
PERL5OPT 208
PERLLIB 208
PERL5DB 208
PERL5SHELL (specific to WIN32 port) 208
PERL_DEBUG_MSTATS 208
PERL_DESTRUCT_LEVEL 208
perlfunc 209
NAME 209
DESCRIPTION 209
Perl Functions by Category 210
Functions for SCALARs or strings 210
Regular expressions and pattern matching 210
Numeric functions 210
Functions for real @ARRAYs 210
Functions for list data 210
Functions for real %HASHes 210
Input and output functions 210
Functions for fixed length data or records 210
Functions for filehandles, files, or directories 210
Keywords related to the control flow of your perl program 210
Keywords related to scoping 210
Miscellaneous functions 210
Functions for processes and process groups 210
Keywords related to perl modules 210
Keywords related to classes and object-orientedness 210
Low-level socket functions 210
System V interprocess communication functions 211
Fetching user and group info 211
Fetching network info 211
Time-related functions 211
Functions new in perl5 210
Functions obsoleted in perl5 210
Alphabetical Listing of Perl Functions 211
-X FILEHANDLE 211
-X EXPR 211
-X 211
abs VALUE 213
abs 213
accept NEWSOCKET,GENERICSOCKET 213
alarm SECONDS 213
alarm 213
atan2 Y,X 213
bind SOCKET,NAME 213
binmode FILEHANDLE 213
bless REF,CLASSNAME 214
bless REF 214
caller EXPR 214
caller 214
chdir EXPR 214
chmod LIST 214
chomp VARIABLE 215
chomp LIST 215
chomp 215
chop VARIABLE 215
chop LIST 215
chop 215
chown LIST 215
chr NUMBER 216
chr 216
chroot FILENAME 216
chroot 216
close FILEHANDLE 216
close 216
closedir DIRHANDLE 216
connect SOCKET,NAME 216
continue BLOCK 217
cos EXPR 217
crypt PLAINTEXT,SALT 217
dbmclose HASH 218
dbmopen HASH,DBNAME,MODE 218
defined EXPR 218
defined 218
delete EXPR 219
die LIST 219
do BLOCK 220
do SUBROUTINE(LIST) 220
do EXPR 220
dump LABEL 221
each HASH 221
eof FILEHANDLE 222
eof () 222
eof 222
eval EXPR 222
eval BLOCK 222
exec LIST 224
exec PROGRAM LIST 224
exists EXPR 225
exit EXPR 225
exp EXPR 225
exp 225
fcntl FILEHANDLE,FUNCTION,SCALAR 225
fileno FILEHANDLE 226
flock FILEHANDLE,OPERATION 226
fork 227
format 227
formline PICTURE,
Read more…