Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / man / man1 / perlfaq.1
CommitLineData
920dae64
AT
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "PERLFAQ 1"
132.TH PERLFAQ 1 "2006-01-07" "perl v5.8.8" "Perl Programmers Reference Guide"
133.SH "NAME"
134perlfaq \- frequently asked questions about Perl
135.SH "DESCRIPTION"
136.IX Header "DESCRIPTION"
137The perlfaq comprises several documents that answer the most commonly
138asked questions about Perl and Perl programming. It's divided by topic
139into nine major sections outlined in this document.
140.Sh "Where to get the perlfaq"
141.IX Subsection "Where to get the perlfaq"
142The perlfaq comes with the standard Perl distribution, so if you have Perl
143you should have the perlfaq. You should also have the \f(CW\*(C`perldoc\*(C'\fR tool
144that let's you read the perlfaq:
145.PP
146.Vb 1
147\& $ perldoc perlfaq
148.Ve
149.PP
150Besides your local system, you can find the perlfaq on the web, including
151at http://perldoc.perl.org/ .
152.PP
153The perlfaq is an evolving document and you can read the latest version
154at http://faq.perl.org/ . The perlfaq-workers periodically post extracts
155of the latest perlfaq to comp.lang.perl.misc.
156.PP
157You can view the source tree at
158http://cvs.perl.org/viewcvs/cvs\-public/perlfaq/ (which is outside of the
159main Perl source tree). The \s-1CVS\s0 repository notes all changes to the \s-1FAQ\s0
160and holds the latest version of the working documents and may vary
161significantly from the version distributed with the latest version of
162Perl. Check the repository before sending your corrections.
163.Sh "How to contribute to the perlfaq"
164.IX Subsection "How to contribute to the perlfaq"
165You can mail corrections, additions, and suggestions to
166\&\f(CW\*(C`<perlfaq\-workers AT perl DOT org>\*(C'\fR. The perlfaq volunteers use this
167address to coordinate their efforts and track the perlfaq development.
168They appreciate your contributions to the \s-1FAQ\s0 but do not have time to
169provide individual help, so don't use this address to ask FAQs.
170.PP
171The perlfaq server posts extracts of the perlfaq to that newsgroup every
1726 hours (or so), and the community of volunteers reviews and updates the
173answers. If you'd like to help review and update the answers, check out
174comp.lang.perl.misc.
175.Sh "What will happen if you mail your Perl programming problems to the authors?"
176.IX Subsection "What will happen if you mail your Perl programming problems to the authors?"
177The perlfaq-workers like to keep all traffic on the perlfaq-workers list
178so that everyone can see the work being done (and the work that needs to
179be done). The mailing list serves as an official record. If you email the
180authors or maintainers directly, you'll probably get a reply asking you
181to post to the mailing list. If you don't get a reply, it probably means
182that the person never saw the message or didn't have time to deal with
183it. Posting to the list allows the volunteers with time to deal with it
184when others are busy.
185.PP
186If you have a question that isn't in the \s-1FAQ\s0 and you would like help with
187it, try the resources in perlfaq2.
188.SH "CREDITS"
189.IX Header "CREDITS"
190Tom Christiansen wrote the original perlfaq then expanded it with the
191help of Nat Torkington. The perlfaq-workers maintain current document
192and the dezinens of comp.lang.perl.misc regularly review and update the
193\&\s-1FAQ\s0. Several people have contributed answers, corrections, and comments,
194and the perlfaq notes those contributions wherever appropriate.
195.SH "AUTHOR AND COPYRIGHT"
196.IX Header "AUTHOR AND COPYRIGHT"
197Tom Christainsen wrote the original version of this document.
198brian d foy \f(CW\*(C`<bdfoy@cpan.org>\*(C'\fR wrote this version. See the
199individual perlfaq documents for additional copyright information.
200.PP
201This document is available under the same terms as Perl itself. Code
202examples in all the perlfaq documents are in the public domain. Use
203them as you see fit (and at your own risk with no warranty from anyone).
204.SH "Table of Contents"
205.IX Header "Table of Contents"
206.IP "perlfaq \- this document" 4
207.IX Item "perlfaq - this document"
208.PD 0
209.IP "perlfaq1 \- General Questions About Perl" 4
210.IX Item "perlfaq1 - General Questions About Perl"
211.IP "perlfaq2 \- Obtaining and Learning about Perl" 4
212.IX Item "perlfaq2 - Obtaining and Learning about Perl"
213.IP "perlfaq3 \- Programming Tools" 4
214.IX Item "perlfaq3 - Programming Tools"
215.IP "perlfaq4 \- Data Manipulation" 4
216.IX Item "perlfaq4 - Data Manipulation"
217.IP "perlfaq5 \- Files and Formats" 4
218.IX Item "perlfaq5 - Files and Formats"
219.IP "perlfaq6 \- Regular Expressions" 4
220.IX Item "perlfaq6 - Regular Expressions"
221.IP "perlfaq7 \- General Perl Language Issues" 4
222.IX Item "perlfaq7 - General Perl Language Issues"
223.IP "perlfaq8 \- System Interaction" 4
224.IX Item "perlfaq8 - System Interaction"
225.IP "perlfaq9 \- Networking" 4
226.IX Item "perlfaq9 - Networking"
227.PD
228.SH "The Questions"
229.IX Header "The Questions"
230.Sh "perlfaq1: General Questions About Perl"
231.IX Subsection "perlfaq1: General Questions About Perl"
232Very general, high-level questions about Perl.
233.IP "\(bu" 4
234What is Perl?
235.IP "\(bu" 4
236Who supports Perl? Who develops it? Why is it free?
237.IP "\(bu" 4
238Which version of Perl should I use?
239.IP "\(bu" 4
240What are perl4, perl5, or perl6?
241.IP "\(bu" 4
242What is Ponie?
243.IP "\(bu" 4
244What is perl6?
245.IP "\(bu" 4
246How stable is Perl?
247.IP "\(bu" 4
248Is Perl difficult to learn?
249.IP "\(bu" 4
250How does Perl compare with other languages like Java, Python, \s-1REXX\s0, Scheme, or Tcl?
251.IP "\(bu" 4
252Can I do [task] in Perl?
253.IP "\(bu" 4
254When shouldn't I program in Perl?
255.IP "\(bu" 4
256What's the difference between \*(L"perl\*(R" and \*(L"Perl\*(R"?
257.IP "\(bu" 4
258Is it a Perl program or a Perl script?
259.IP "\(bu" 4
260What is a \s-1JAPH\s0?
261.IP "\(bu" 4
262Where can I get a list of Larry Wall witticisms?
263.IP "\(bu" 4
264How can I convince my sysadmin/supervisor/employees to use version 5/5.6.1/Perl instead of some other language?
265.Sh "perlfaq2: Obtaining and Learning about Perl"
266.IX Subsection "perlfaq2: Obtaining and Learning about Perl"
267Where to find source and documentation for Perl, support, and related matters.
268.IP "\(bu" 4
269What machines support perl? Where do I get it?
270.IP "\(bu" 4
271How can I get a binary version of perl?
272.IP "\(bu" 4
273I don't have a C compiler. How can I build my own Perl interpreter?
274.IP "\(bu" 4
275I copied the perl binary from one machine to another, but scripts don't work.
276.IP "\(bu" 4
277I grabbed the sources and tried to compile but gdbm/dynamic loading/malloc/linking/... failed. How do I make it work?
278.IP "\(bu" 4
279What modules and extensions are available for Perl? What is \s-1CPAN\s0? What does CPAN/src/... mean?
280.IP "\(bu" 4
281Is there an \s-1ISO\s0 or \s-1ANSI\s0 certified version of Perl?
282.IP "\(bu" 4
283Where can I get information on Perl?
284.IP "\(bu" 4
285What are the Perl newsgroups on Usenet? Where do I post questions?
286.IP "\(bu" 4
287Where should I post source code?
288.IP "\(bu" 4
289Perl Books
290.IP "\(bu" 4
291Which magazines have Perl content?
292.IP "\(bu" 4
293What mailing lists are there for Perl?
294.IP "\(bu" 4
295Where are the archives for comp.lang.perl.misc?
296.IP "\(bu" 4
297Where can I buy a commercial version of perl?
298.IP "\(bu" 4
299Where do I send bug reports?
300.IP "\(bu" 4
301What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?
302.Sh "perlfaq3: Programming Tools"
303.IX Subsection "perlfaq3: Programming Tools"
304Programmer tools and programming support.
305.IP "\(bu" 4
306How do I do (anything)?
307.IP "\(bu" 4
308How can I use Perl interactively?
309.IP "\(bu" 4
310Is there a Perl shell?
311.IP "\(bu" 4
312How do I find which modules are installed on my system?
313.IP "\(bu" 4
314How do I debug my Perl programs?
315.IP "\(bu" 4
316How do I profile my Perl programs?
317.IP "\(bu" 4
318How do I cross-reference my Perl programs?
319.IP "\(bu" 4
320Is there a pretty-printer (formatter) for Perl?
321.IP "\(bu" 4
322Is there a ctags for Perl?
323.IP "\(bu" 4
324Is there an \s-1IDE\s0 or Windows Perl Editor?
325.IP "\(bu" 4
326Where can I get Perl macros for vi?
327.IP "\(bu" 4
328Where can I get perl-mode for emacs?
329.IP "\(bu" 4
330How can I use curses with Perl?
331.IP "\(bu" 4
332How can I use X or Tk with Perl?
333.IP "\(bu" 4
334How can I make my Perl program run faster?
335.IP "\(bu" 4
336How can I make my Perl program take less memory?
337.IP "\(bu" 4
338Is it safe to return a reference to local or lexical data?
339.IP "\(bu" 4
340How can I free an array or hash so my program shrinks?
341.IP "\(bu" 4
342How can I make my \s-1CGI\s0 script more efficient?
343.IP "\(bu" 4
344How can I hide the source for my Perl program?
345.IP "\(bu" 4
346How can I compile my Perl program into byte code or C?
347.IP "\(bu" 4
348How can I compile Perl into Java?
349.IP "\(bu" 4
350How can I get \f(CW\*(C`#!perl\*(C'\fR to work on [\s-1MS\-DOS\s0,NT,...]?
351.IP "\(bu" 4
352Can I write useful Perl programs on the command line?
353.IP "\(bu" 4
354Why don't Perl one-liners work on my DOS/Mac/VMS system?
355.IP "\(bu" 4
356Where can I learn about \s-1CGI\s0 or Web programming in Perl?
357.IP "\(bu" 4
358Where can I learn about object-oriented Perl programming?
359.IP "\(bu" 4
360Where can I learn about linking C with Perl?
361.IP "\(bu" 4
362I've read perlembed, perlguts, etc., but I can't embed perl in my C program; what am I doing wrong?
363.IP "\(bu" 4
364When I tried to run my script, I got this message. What does it mean?
365.IP "\(bu" 4
366What's MakeMaker?
367.Sh "perlfaq4: Data Manipulation"
368.IX Subsection "perlfaq4: Data Manipulation"
369Manipulating numbers, dates, strings, arrays, hashes, and miscellaneous data issues.
370.IP "\(bu" 4
371Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?
372.IP "\(bu" 4
373Why is \fIint()\fR broken?
374.IP "\(bu" 4
375Why isn't my octal data interpreted correctly?
376.IP "\(bu" 4
377Does Perl have a \fIround()\fR function? What about \fIceil()\fR and \fIfloor()\fR? Trig functions?
378.IP "\(bu" 4
379How do I convert between numeric representations/bases/radixes?
380.IP "\(bu" 4
381Why doesn't & work the way I want it to?
382.IP "\(bu" 4
383How do I multiply matrices?
384.IP "\(bu" 4
385How do I perform an operation on a series of integers?
386.IP "\(bu" 4
387How can I output Roman numerals?
388.IP "\(bu" 4
389Why aren't my random numbers random?
390.IP "\(bu" 4
391How do I get a random number between X and Y?
392.IP "\(bu" 4
393How do I find the day or week of the year?
394.IP "\(bu" 4
395How do I find the current century or millennium?
396.IP "\(bu" 4
397How can I compare two dates and find the difference?
398.IP "\(bu" 4
399How can I take a string and turn it into epoch seconds?
400.IP "\(bu" 4
401How can I find the Julian Day?
402.IP "\(bu" 4
403How do I find yesterday's date?
404.IP "\(bu" 4
405Does Perl have a Year 2000 problem? Is Perl Y2K compliant?
406.IP "\(bu" 4
407How do I validate input?
408.IP "\(bu" 4
409How do I unescape a string?
410.IP "\(bu" 4
411How do I remove consecutive pairs of characters?
412.IP "\(bu" 4
413How do I expand function calls in a string?
414.IP "\(bu" 4
415How do I find matching/nesting anything?
416.IP "\(bu" 4
417How do I reverse a string?
418.IP "\(bu" 4
419How do I expand tabs in a string?
420.IP "\(bu" 4
421How do I reformat a paragraph?
422.IP "\(bu" 4
423How can I access or change N characters of a string?
424.IP "\(bu" 4
425How do I change the Nth occurrence of something?
426.IP "\(bu" 4
427How can I count the number of occurrences of a substring within a string?
428.IP "\(bu" 4
429How do I capitalize all the words on one line?
430.IP "\(bu" 4
431How can I split a [character] delimited string except when inside [character]?
432.IP "\(bu" 4
433How do I strip blank space from the beginning/end of a string?
434.IP "\(bu" 4
435How do I pad a string with blanks or pad a number with zeroes?
436.IP "\(bu" 4
437How do I extract selected columns from a string?
438.IP "\(bu" 4
439How do I find the soundex value of a string?
440.IP "\(bu" 4
441How can I expand variables in text strings?
442.IP "\(bu" 4
443What's wrong with always quoting \*(L"$vars\*(R"?
444.IP "\(bu" 4
445Why don't my <<\s-1HERE\s0 documents work?
446.IP "\(bu" 4
447What is the difference between a list and an array?
448.IP "\(bu" 4
449What is the difference between \f(CW$array\fR[1] and \f(CW@array\fR[1]?
450.IP "\(bu" 4
451How can I remove duplicate elements from a list or array?
452.IP "\(bu" 4
453How can I tell whether a certain element is contained in a list or array?
454.IP "\(bu" 4
455How do I compute the difference of two arrays? How do I compute the intersection of two arrays?
456.IP "\(bu" 4
457How do I test whether two arrays or hashes are equal?
458.IP "\(bu" 4
459How do I find the first array element for which a condition is true?
460.IP "\(bu" 4
461How do I handle linked lists?
462.IP "\(bu" 4
463How do I handle circular lists?
464.IP "\(bu" 4
465How do I shuffle an array randomly?
466.IP "\(bu" 4
467How do I process/modify each element of an array?
468.IP "\(bu" 4
469How do I select a random element from an array?
470.IP "\(bu" 4
471How do I permute N elements of a list?
472.IP "\(bu" 4
473How do I sort an array by (anything)?
474.IP "\(bu" 4
475How do I manipulate arrays of bits?
476.IP "\(bu" 4
477Why does \fIdefined()\fR return true on empty arrays and hashes?
478.IP "\(bu" 4
479How do I process an entire hash?
480.IP "\(bu" 4
481What happens if I add or remove keys from a hash while iterating over it?
482.IP "\(bu" 4
483How do I look up a hash element by value?
484.IP "\(bu" 4
485How can I know how many entries are in a hash?
486.IP "\(bu" 4
487How do I sort a hash (optionally by value instead of key)?
488.IP "\(bu" 4
489How can I always keep my hash sorted?
490.IP "\(bu" 4
491What's the difference between \*(L"delete\*(R" and \*(L"undef\*(R" with hashes?
492.IP "\(bu" 4
493Why don't my tied hashes make the defined/exists distinction?
494.IP "\(bu" 4
495How do I reset an \fIeach()\fR operation part-way through?
496.IP "\(bu" 4
497How can I get the unique keys from two hashes?
498.IP "\(bu" 4
499How can I store a multidimensional array in a \s-1DBM\s0 file?
500.IP "\(bu" 4
501How can I make my hash remember the order I put elements into it?
502.IP "\(bu" 4
503Why does passing a subroutine an undefined element in a hash create it?
504.IP "\(bu" 4
505How can I make the Perl equivalent of a C structure/\*(C+ class/hash or array of hashes or arrays?
506.IP "\(bu" 4
507How can I use a reference as a hash key?
508.IP "\(bu" 4
509How do I handle binary data correctly?
510.IP "\(bu" 4
511How do I determine whether a scalar is a number/whole/integer/float?
512.IP "\(bu" 4
513How do I keep persistent data across program calls?
514.IP "\(bu" 4
515How do I print out or copy a recursive data structure?
516.IP "\(bu" 4
517How do I define methods for every class/object?
518.IP "\(bu" 4
519How do I verify a credit card checksum?
520.IP "\(bu" 4
521How do I pack arrays of doubles or floats for \s-1XS\s0 code?
522.Sh "perlfaq5: Files and Formats"
523.IX Subsection "perlfaq5: Files and Formats"
524I/O and the \*(L"f\*(R" issues: filehandles, flushing, formats, and footers.
525.IP "\(bu" 4
526How do I flush/unbuffer an output filehandle? Why must I do this?
527.IP "\(bu" 4
528How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?
529.IP "\(bu" 4
530How do I count the number of lines in a file?
531.IP "\(bu" 4
532How can I use Perl's \f(CW\*(C`\-i\*(C'\fR option from within a program?
533.IP "\(bu" 4
534How can I copy a file?
535.IP "\(bu" 4
536How do I make a temporary file name?
537.IP "\(bu" 4
538How can I manipulate fixed-record-length files?
539.IP "\(bu" 4
540How can I make a filehandle local to a subroutine? How do I pass filehandles between subroutines? How do I make an array of filehandles?
541.IP "\(bu" 4
542How can I use a filehandle indirectly?
543.IP "\(bu" 4
544How can I set up a footer format to be used with \fIwrite()\fR?
545.IP "\(bu" 4
546How can I \fIwrite()\fR into a string?
547.IP "\(bu" 4
548How can I output my numbers with commas added?
549.IP "\(bu" 4
550How can I translate tildes (~) in a filename?
551.IP "\(bu" 4
552How come when I open a file read-write it wipes it out?
553.IP "\(bu" 4
554Why do I sometimes get an \*(L"Argument list too long\*(R" when I use <*>?
555.IP "\(bu" 4
556Is there a leak/bug in \fIglob()\fR?
557.IP "\(bu" 4
558How can I open a file with a leading \*(L">\*(R" or trailing blanks?
559.IP "\(bu" 4
560How can I reliably rename a file?
561.IP "\(bu" 4
562How can I lock a file?
563.IP "\(bu" 4
564Why can't I just open(\s-1FH\s0, ">file.lock")?
565.IP "\(bu" 4
566I still don't get locking. I just want to increment the number in the file. How can I do this?
567.IP "\(bu" 4
568All I want to do is append a small amount of text to the end of a file. Do I still have to use locking?
569.IP "\(bu" 4
570How do I randomly update a binary file?
571.IP "\(bu" 4
572How do I get a file's timestamp in perl?
573.IP "\(bu" 4
574How do I set a file's timestamp in perl?
575.IP "\(bu" 4
576How do I print to more than one file at once?
577.IP "\(bu" 4
578How can I read in an entire file all at once?
579.IP "\(bu" 4
580How can I read in a file by paragraphs?
581.IP "\(bu" 4
582How can I read a single character from a file? From the keyboard?
583.IP "\(bu" 4
584How can I tell whether there's a character waiting on a filehandle?
585.IP "\(bu" 4
586How do I do a \f(CW\*(C`tail \-f\*(C'\fR in perl?
587.IP "\(bu" 4
588How do I \fIdup()\fR a filehandle in Perl?
589.IP "\(bu" 4
590How do I close a file descriptor by number?
591.IP "\(bu" 4
592Why can't I use \*(L"C:\etemp\efoo\*(R" in \s-1DOS\s0 paths? Why doesn't `C:\etemp\efoo.exe` work?
593.IP "\(bu" 4
594Why doesn't glob(\*(L"*.*\*(R") get all the files?
595.IP "\(bu" 4
596Why does Perl let me delete read-only files? Why does \f(CW\*(C`\-i\*(C'\fR clobber protected files? Isn't this a bug in Perl?
597.IP "\(bu" 4
598How do I select a random line from a file?
599.IP "\(bu" 4
600Why do I get weird spaces when I print an array of lines?
601.Sh "perlfaq6: Regular Expressions"
602.IX Subsection "perlfaq6: Regular Expressions"
603This section is surprisingly small because the rest of the \s-1FAQ\s0 is littered with answers involving regular expressions. For example, decoding a \s-1URL\s0 and checking whether something is a number are handled with regular expressions, but those answers are found elsewhere in this document (in perlfaq9: \*(L"How do I decode or create those %\-encodings on the web\*(R" and perlfaq4: \*(L"How do I determine whether a scalar is a number/whole/integer/float\*(R", to be precise).
604.IP "\(bu" 4
605How can I hope to use regular expressions without creating illegible and unmaintainable code?
606.IP "\(bu" 4
607I'm having trouble matching over more than one line. What's wrong?
608.IP "\(bu" 4
609How can I pull out lines between two patterns that are themselves on different lines?
610.IP "\(bu" 4
611I put a regular expression into $/ but it didn't work. What's wrong?
612.IP "\(bu" 4
613How do I substitute case insensitively on the \s-1LHS\s0 while preserving case on the \s-1RHS\s0?
614.IP "\(bu" 4
615How can I make \f(CW\*(C`\ew\*(C'\fR match national character sets?
616.IP "\(bu" 4
617How can I match a locale-smart version of \f(CW\*(C`/[a\-zA\-Z]/\*(C'\fR?
618.IP "\(bu" 4
619How can I quote a variable to use in a regex?
620.IP "\(bu" 4
621What is \f(CW\*(C`/o\*(C'\fR really for?
622.IP "\(bu" 4
623How do I use a regular expression to strip C style comments from a file?
624.IP "\(bu" 4
625Can I use Perl regular expressions to match balanced text?
626.IP "\(bu" 4
627What does it mean that regexes are greedy? How can I get around it?
628.IP "\(bu" 4
629How do I process each word on each line?
630.IP "\(bu" 4
631How can I print out a word-frequency or line-frequency summary?
632.IP "\(bu" 4
633How can I do approximate matching?
634.IP "\(bu" 4
635How do I efficiently match many regular expressions at once?
636.IP "\(bu" 4
637Why don't word-boundary searches with \f(CW\*(C`\eb\*(C'\fR work for me?
638.IP "\(bu" 4
639Why does using $&, $`, or $' slow my program down?
640.IP "\(bu" 4
641What good is \f(CW\*(C`\eG\*(C'\fR in a regular expression?
642.IP "\(bu" 4
643Are Perl regexes DFAs or NFAs? Are they \s-1POSIX\s0 compliant?
644.IP "\(bu" 4
645What's wrong with using grep in a void context?
646.IP "\(bu" 4
647How can I match strings with multibyte characters?
648.IP "\(bu" 4
649How do I match a pattern that is supplied by the user?
650.Sh "perlfaq7: General Perl Language Issues"
651.IX Subsection "perlfaq7: General Perl Language Issues"
652General Perl language issues that don't clearly fit into any of the other sections.
653.IP "\(bu" 4
654Can I get a BNF/yacc/RE for the Perl language?
655.IP "\(bu" 4
656What are all these $@%&* punctuation signs, and how do I know when to use them?
657.IP "\(bu" 4
658Do I always/never have to quote my strings or use semicolons and commas?
659.IP "\(bu" 4
660How do I skip some return values?
661.IP "\(bu" 4
662How do I temporarily block warnings?
663.IP "\(bu" 4
664What's an extension?
665.IP "\(bu" 4
666Why do Perl operators have different precedence than C operators?
667.IP "\(bu" 4
668How do I declare/create a structure?
669.IP "\(bu" 4
670How do I create a module?
671.IP "\(bu" 4
672How do I create a class?
673.IP "\(bu" 4
674How can I tell if a variable is tainted?
675.IP "\(bu" 4
676What's a closure?
677.IP "\(bu" 4
678What is variable suicide and how can I prevent it?
679.IP "\(bu" 4
680How can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?
681.IP "\(bu" 4
682How do I create a static variable?
683.IP "\(bu" 4
684What's the difference between dynamic and lexical (static) scoping? Between \fIlocal()\fR and \fImy()\fR?
685.IP "\(bu" 4
686How can I access a dynamic variable while a similarly named lexical is in scope?
687.IP "\(bu" 4
688What's the difference between deep and shallow binding?
689.IP "\(bu" 4
690Why doesn't "my($foo) = <\s-1FILE\s0>;" work right?
691.IP "\(bu" 4
692How do I redefine a builtin function, operator, or method?
693.IP "\(bu" 4
694What's the difference between calling a function as &foo and \fIfoo()\fR?
695.IP "\(bu" 4
696How do I create a switch or case statement?
697.IP "\(bu" 4
698How can I catch accesses to undefined variables, functions, or methods?
699.IP "\(bu" 4
700Why can't a method included in this same file be found?
701.IP "\(bu" 4
702How can I find out my current package?
703.IP "\(bu" 4
704How can I comment out a large block of perl code?
705.IP "\(bu" 4
706How do I clear a package?
707.IP "\(bu" 4
708How can I use a variable as a variable name?
709.IP "\(bu" 4
710What does \*(L"bad interpreter\*(R" mean?
711.Sh "perlfaq8: System Interaction"
712.IX Subsection "perlfaq8: System Interaction"
713This section of the Perl \s-1FAQ\s0 covers questions involving operating system interaction. Topics include interprocess communication (\s-1IPC\s0), control over the user-interface (keyboard, screen and pointing devices), and most anything else not related to data manipulation. Read the FAQs and documentation specific to the port of perl to your operating system (eg, perlvms, perlplan9, ...). These should contain more detailed information on the vagaries of your perl.
714.IP "\(bu" 4
715How do I find out which operating system I'm running under?
716.IP "\(bu" 4
717How come \fIexec()\fR doesn't return?
718.IP "\(bu" 4
719How do I do fancy stuff with the keyboard/screen/mouse?
720.IP "\(bu" 4
721How do I print something out in color?
722.IP "\(bu" 4
723How do I read just one key without waiting for a return key?
724.IP "\(bu" 4
725How do I check whether input is ready on the keyboard?
726.IP "\(bu" 4
727How do I clear the screen?
728.IP "\(bu" 4
729How do I get the screen size?
730.IP "\(bu" 4
731How do I ask the user for a password?
732.IP "\(bu" 4
733How do I read and write the serial port?
734.IP "\(bu" 4
735How do I decode encrypted password files?
736.IP "\(bu" 4
737How do I start a process in the background?
738.IP "\(bu" 4
739How do I trap control characters/signals?
740.IP "\(bu" 4
741How do I modify the shadow password file on a Unix system?
742.IP "\(bu" 4
743How do I set the time and date?
744.IP "\(bu" 4
745How can I \fIsleep()\fR or \fIalarm()\fR for under a second?
746.IP "\(bu" 4
747How can I measure time under a second?
748.IP "\(bu" 4
749How can I do an \fIatexit()\fR or \fIsetjmp()\fR/\fIlongjmp()\fR? (Exception handling)
750.IP "\(bu" 4
751Why doesn't my sockets program work under System V (Solaris)? What does the error message \*(L"Protocol not supported\*(R" mean?
752.IP "\(bu" 4
753How can I call my system's unique C functions from Perl?
754.IP "\(bu" 4
755Where do I get the include files to do \fIioctl()\fR or \fIsyscall()\fR?
756.IP "\(bu" 4
757Why do setuid perl scripts complain about kernel problems?
758.IP "\(bu" 4
759How can I open a pipe both to and from a command?
760.IP "\(bu" 4
761Why can't I get the output of a command with \fIsystem()\fR?
762.IP "\(bu" 4
763How can I capture \s-1STDERR\s0 from an external command?
764.IP "\(bu" 4
765Why doesn't \fIopen()\fR return an error when a pipe open fails?
766.IP "\(bu" 4
767What's wrong with using backticks in a void context?
768.IP "\(bu" 4
769How can I call backticks without shell processing?
770.IP "\(bu" 4
771Why can't my script read from \s-1STDIN\s0 after I gave it \s-1EOF\s0 (^D on Unix, ^Z on \s-1MS\-DOS\s0)?
772.IP "\(bu" 4
773How can I convert my shell script to perl?
774.IP "\(bu" 4
775Can I use perl to run a telnet or ftp session?
776.IP "\(bu" 4
777How can I write expect in Perl?
778.IP "\(bu" 4
779Is there a way to hide perl's command line from programs such as \*(L"ps\*(R"?
780.IP "\(bu" 4
781I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible?
782.IP "\(bu" 4
783How do I close a process's filehandle without waiting for it to complete?
784.IP "\(bu" 4
785How do I fork a daemon process?
786.IP "\(bu" 4
787How do I find out if I'm running interactively or not?
788.IP "\(bu" 4
789How do I timeout a slow event?
790.IP "\(bu" 4
791How do I set \s-1CPU\s0 limits?
792.IP "\(bu" 4
793How do I avoid zombies on a Unix system?
794.IP "\(bu" 4
795How do I use an \s-1SQL\s0 database?
796.IP "\(bu" 4
797How do I make a \fIsystem()\fR exit on control\-C?
798.IP "\(bu" 4
799How do I open a file without blocking?
800.IP "\(bu" 4
801How do I tell the difference between errors from the shell and perl?
802.IP "\(bu" 4
803How do I install a module from \s-1CPAN\s0?
804.IP "\(bu" 4
805What's the difference between require and use?
806.IP "\(bu" 4
807How do I keep my own module/library directory?
808.IP "\(bu" 4
809How do I add the directory my program lives in to the module/library search path?
810.IP "\(bu" 4
811How do I add a directory to my include path (@INC) at runtime?
812.IP "\(bu" 4
813What is socket.ph and where do I get it?
814.Sh "perlfaq9: Networking"
815.IX Subsection "perlfaq9: Networking"
816Networking, the internet, and a few on the web.
817.IP "\(bu" 4
818What is the correct form of response from a \s-1CGI\s0 script?
819.IP "\(bu" 4
820My \s-1CGI\s0 script runs from the command line but not the browser. (500 Server Error)
821.IP "\(bu" 4
822How can I get better error messages from a \s-1CGI\s0 program?
823.IP "\(bu" 4
824How do I remove \s-1HTML\s0 from a string?
825.IP "\(bu" 4
826How do I extract URLs?
827.IP "\(bu" 4
828How do I download a file from the user's machine? How do I open a file on another machine?
829.IP "\(bu" 4
830How do I make a pop-up menu in \s-1HTML\s0?
831.IP "\(bu" 4
832How do I fetch an \s-1HTML\s0 file?
833.IP "\(bu" 4
834How do I automate an \s-1HTML\s0 form submission?
835.IP "\(bu" 4
836How do I decode or create those %\-encodings on the web?
837.IP "\(bu" 4
838How do I redirect to another page?
839.IP "\(bu" 4
840How do I put a password on my web pages?
841.IP "\(bu" 4
842How do I edit my .htpasswd and .htgroup files with Perl?
843.IP "\(bu" 4
844How do I make sure users can't enter values into a form that cause my \s-1CGI\s0 script to do bad things?
845.IP "\(bu" 4
846How do I parse a mail header?
847.IP "\(bu" 4
848How do I decode a \s-1CGI\s0 form?
849.IP "\(bu" 4
850How do I check a valid mail address?
851.IP "\(bu" 4
852How do I decode a \s-1MIME/BASE64\s0 string?
853.IP "\(bu" 4
854How do I return the user's mail address?
855.IP "\(bu" 4
856How do I send mail?
857.IP "\(bu" 4
858How do I use \s-1MIME\s0 to make an attachment to a mail message?
859.IP "\(bu" 4
860How do I read mail?
861.IP "\(bu" 4
862How do I find out my hostname, domainname, or \s-1IP\s0 address?
863.IP "\(bu" 4
864How do I fetch a news article or the active newsgroups?
865.IP "\(bu" 4
866How do I fetch/put an \s-1FTP\s0 file?
867.IP "\(bu" 4
868How can I do \s-1RPC\s0 in Perl?