1N/A=head1 NAME
1N/A
1N/Aperlfaq - frequently asked questions about Perl ($Date: 2003/01/31 17:37:17 $)
1N/A
1N/A=head1 DESCRIPTION
1N/A
1N/AThe perlfaq is divided into several documents based on topics. A table
1N/Aof contents is at the end of this document.
1N/A
1N/A=head2 Where to get the perlfaq
1N/A
1N/AExtracts of the perlfaq are posted regularly to
1N/Acomp.lang.perl.misc. It is available on many web sites:
1N/Ahttp://www.perldoc.com/ and http://faq.perl.org/
1N/A
1N/A=head2 How to contribute to the perlfaq
1N/A
1N/AYou may mail corrections, additions, and suggestions to
1N/Aperlfaq-workers@perl.org . This alias should not be used to
1N/AI<ask> FAQs. It's for fixing the current FAQ. Send
1N/Aquestions to the comp.lang.perl.misc newsgroup. You can
1N/Aview the source tree at http://cvs.perl.org/cvsweb/perlfaq/
1N/A(which is outside of the main Perl source tree). The CVS
1N/Arepository notes all changes to the FAQ.
1N/A
1N/A=head2 What will happen if you mail your Perl programming problems to the authors
1N/A
1N/AYour questions will probably go unread, unless they're
1N/Asuggestions of new questions to add to the FAQ, in which
1N/Acase they should have gone to the perlfaq-workers@perl.org
1N/Ainstead.
1N/A
1N/AYou should have read section 2 of this faq. There you would
1N/Ahave learned that comp.lang.perl.misc is the appropriate
1N/Aplace to go for free advice. If your question is really
1N/Aimportant and you require a prompt and correct answer, you
1N/Ashould hire a consultant.
1N/A
1N/A=head1 Credits
1N/A
1N/AThe original perlfaq was written by Tom Christiansen, then expanded
1N/Aby collaboration between Tom and Nathan Torkington. The current
1N/Adocument is maintained by the perlfaq-workers (perlfaq-workers@perl.org).
1N/ASeveral people have contributed answers, corrections, and comments.
1N/A
1N/A=head1 Author and Copyright Information
1N/A
1N/ACopyright (c) 1997-2003 Tom Christiansen, Nathan Torkington, and
1N/Aother contributors noted in the answers.
1N/A
1N/AAll rights reserved.
1N/A
1N/A=head2 Bundled Distributions
1N/A
1N/AThis documentation is free; you can redistribute it and/or modify it
1N/Aunder the same terms as Perl itself.
1N/A
1N/AIrrespective of its distribution, all code examples in these files
1N/Aare hereby placed into the public domain. You are permitted and
1N/Aencouraged to use this code in your own programs for fun
1N/Aor for profit as you see fit. A simple comment in the code giving
1N/Acredit would be courteous but is not required.
1N/A
1N/A=head2 Disclaimer
1N/A
1N/AThis information is offered in good faith and in the hope that it may
1N/Abe of use, but is not guaranteed to be correct, up to date, or suitable
1N/Afor any particular purpose whatsoever. The authors accept no liability
1N/Ain respect of this information or its use.
1N/A
1N/A=head1 Table of Contents
1N/A
1N/A=over 4
1N/A
1N/A=item perlfaq - this document
1N/A
1N/A=item perlfaq1 - General Questions About Perl
1N/A
1N/A=item perlfaq2 - Obtaining and Learning about Perl
1N/A
1N/A=item perlfaq3 - Programming Tools
1N/A
1N/A=item perlfaq4 - Data Manipulation
1N/A
1N/A=item perlfaq5 - Files and Formats
1N/A
1N/A=item perlfaq6 - Regular Expressions
1N/A
1N/A=item perlfaq7 - General Perl Language Issues
1N/A
1N/A=item perlfaq8 - System Interaction
1N/A
1N/A=item perlfaq9 - Networking
1N/A
1N/A
1N/A=back
1N/A
1N/A
1N/A=head1 The Questions
1N/A
1N/A=head2 L<perlfaq1>: General Questions About Perl
1N/A
1N/AVery general, high-level questions about Perl.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AWhat is Perl?
1N/A
1N/A=item *
1N/A
1N/AWho supports Perl? Who develops it? Why is it free?
1N/A
1N/A=item *
1N/A
1N/AWhich version of Perl should I use?
1N/A
1N/A=item *
1N/A
1N/AWhat are perl4 and perl5?
1N/A
1N/A=item *
1N/A
1N/AWhat is perl6?
1N/A
1N/A=item *
1N/A
1N/AHow stable is Perl?
1N/A
1N/A=item *
1N/A
1N/AIs Perl difficult to learn?
1N/A
1N/A=item *
1N/A
1N/AHow does Perl compare with other languages like Java, Python, REXX, Scheme, or Tcl?
1N/A
1N/A=item *
1N/A
1N/ACan I do [task] in Perl?
1N/A
1N/A=item *
1N/A
1N/AWhen shouldn't I program in Perl?
1N/A
1N/A=item *
1N/A
1N/AWhat's the difference between "perl" and "Perl"?
1N/A
1N/A=item *
1N/A
1N/AIs it a Perl program or a Perl script?
1N/A
1N/A=item *
1N/A
1N/AWhat is a JAPH?
1N/A
1N/A=item *
1N/A
1N/AWhere can I get a list of Larry Wall witticisms?
1N/A
1N/A=item *
1N/A
1N/AHow can I convince my sysadmin/supervisor/employees to use version 5/5.6.1/Perl instead of some other language?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq2>: Obtaining and Learning about Perl
1N/A
1N/AWhere to find source and documentation for Perl, support,
1N/Aand related matters.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AWhat machines support Perl? Where do I get it?
1N/A
1N/A=item *
1N/A
1N/AHow can I get a binary version of Perl?
1N/A
1N/A=item *
1N/A
1N/AI don't have a C compiler on my system. How can I compile perl?
1N/A
1N/A=item *
1N/A
1N/AI copied the Perl binary from one machine to another, but scripts don't work.
1N/A
1N/A=item *
1N/A
1N/AI grabbed the sources and tried to compile but gdbm/dynamic loading/malloc/linking/... failed. How do I make it work?
1N/A
1N/A=item *
1N/A
1N/AWhat modules and extensions are available for Perl? What is CPAN? What does CPAN/src/... mean?
1N/A
1N/A=item *
1N/A
1N/AIs there an ISO or ANSI certified version of Perl?
1N/A
1N/A=item *
1N/A
1N/AWhere can I get information on Perl?
1N/A
1N/A=item *
1N/A
1N/AWhat are the Perl newsgroups on Usenet? Where do I post questions?
1N/A
1N/A=item *
1N/A
1N/AWhere should I post source code?
1N/A
1N/A=item *
1N/A
1N/APerl Books
1N/A
1N/A=item *
1N/A
1N/APerl in Magazines
1N/A
1N/A=item *
1N/A
1N/APerl on the Net: FTP and WWW Access
1N/A
1N/A=item *
1N/A
1N/AWhat mailing lists are there for Perl?
1N/A
1N/A=item *
1N/A
1N/AArchives of comp.lang.perl.misc
1N/A
1N/A=item *
1N/A
1N/AWhere can I buy a commercial version of Perl?
1N/A
1N/A=item *
1N/A
1N/AWhere do I send bug reports?
1N/A
1N/A=item *
1N/A
1N/AWhat is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq3>: Programming Tools
1N/A
1N/AProgrammer tools and programming support.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AHow do I do (anything)?
1N/A
1N/A=item *
1N/A
1N/AHow can I use Perl interactively?
1N/A
1N/A=item *
1N/A
1N/AIs there a Perl shell?
1N/A
1N/A=item *
1N/A
1N/AHow do I find which modules are installed on my system?
1N/A
1N/A=item *
1N/A
1N/AHow do I debug my Perl programs?
1N/A
1N/A=item *
1N/A
1N/AHow do I profile my Perl programs?
1N/A
1N/A=item *
1N/A
1N/AHow do I cross-reference my Perl programs?
1N/A
1N/A=item *
1N/A
1N/AIs there a pretty-printer (formatter) for Perl?
1N/A
1N/A=item *
1N/A
1N/AIs there a ctags for Perl?
1N/A
1N/A=item *
1N/A
1N/AIs there an IDE or Windows Perl Editor?
1N/A
1N/A=item *
1N/A
1N/AWhere can I get Perl macros for vi?
1N/A
1N/A=item *
1N/A
1N/AWhere can I get perl-mode for emacs?
1N/A
1N/A=item *
1N/A
1N/AHow can I use curses with Perl?
1N/A
1N/A=item *
1N/A
1N/AHow can I use X or Tk with Perl?
1N/A
1N/A=item *
1N/A
1N/AHow can I generate simple menus without using CGI or Tk?
1N/A
1N/A=item *
1N/A
1N/AHow can I make my Perl program run faster?
1N/A
1N/A=item *
1N/A
1N/AHow can I make my Perl program take less memory?
1N/A
1N/A=item *
1N/A
1N/AIs it safe to return a reference to local or lexical data?
1N/A
1N/A=item *
1N/A
1N/AHow can I free an array or hash so my program shrinks?
1N/A
1N/A=item *
1N/A
1N/AHow can I make my CGI script more efficient?
1N/A
1N/A=item *
1N/A
1N/AHow can I hide the source for my Perl program?
1N/A
1N/A=item *
1N/A
1N/AHow can I compile my Perl program into byte code or C?
1N/A
1N/A=item *
1N/A
1N/AHow can I compile Perl into Java?
1N/A
1N/A=item *
1N/A
1N/AHow can I get C<#!perl> to work on [MS-DOS,NT,...]?
1N/A
1N/A=item *
1N/A
1N/ACan I write useful Perl programs on the command line?
1N/A
1N/A=item *
1N/A
1N/AWhy don't Perl one-liners work on my DOS/Mac/VMS system?
1N/A
1N/A=item *
1N/A
1N/AWhere can I learn about CGI or Web programming in Perl?
1N/A
1N/A=item *
1N/A
1N/AWhere can I learn about object-oriented Perl programming?
1N/A
1N/A=item *
1N/A
1N/AWhere can I learn about linking C with Perl? [h2xs, xsubpp]
1N/A
1N/A=item *
1N/A
1N/AI've read perlembed, perlguts, etc., but I can't embed perl in
1N/Amy C program; what am I doing wrong?
1N/A
1N/A=item *
1N/A
1N/AWhen I tried to run my script, I got this message. What does it mean?
1N/A
1N/A=item *
1N/A
1N/AWhat's MakeMaker?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq4>: Data Manipulation
1N/A
1N/AManipulating numbers, dates, strings, arrays, hashes, and
1N/Amiscellaneous data issues.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AWhy am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?
1N/A
1N/A=item *
1N/A
1N/AWhy isn't my octal data interpreted correctly?
1N/A
1N/A=item *
1N/A
1N/ADoes Perl have a round() function? What about ceil() and floor()? Trig functions?
1N/A
1N/A=item *
1N/A
1N/AHow do I convert between numeric representations?
1N/A
1N/A=item *
1N/A
1N/AWhy doesn't & work the way I want it to?
1N/A
1N/A=item *
1N/A
1N/AHow do I multiply matrices?
1N/A
1N/A=item *
1N/A
1N/AHow do I perform an operation on a series of integers?
1N/A
1N/A=item *
1N/A
1N/AHow can I output Roman numerals?
1N/A
1N/A=item *
1N/A
1N/AWhy aren't my random numbers random?
1N/A
1N/A=item *
1N/A
1N/AHow do I get a random number between X and Y?
1N/A
1N/A=item *
1N/A
1N/AHow do I find the day or week of the year?
1N/A
1N/A=item *
1N/A
1N/AHow do I find the current century or millennium?
1N/A
1N/A=item *
1N/A
1N/AHow can I compare two dates and find the difference?
1N/A
1N/A=item *
1N/A
1N/AHow can I take a string and turn it into epoch seconds?
1N/A
1N/A=item *
1N/A
1N/AHow can I find the Julian Day?
1N/A
1N/A=item *
1N/A
1N/AHow do I find yesterday's date?
1N/A
1N/A=item *
1N/A
1N/ADoes Perl have a Year 2000 problem? Is Perl Y2K compliant?
1N/A
1N/A=item *
1N/A
1N/AHow do I validate input?
1N/A
1N/A=item *
1N/A
1N/AHow do I unescape a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I remove consecutive pairs of characters?
1N/A
1N/A=item *
1N/A
1N/AHow do I expand function calls in a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I find matching/nesting anything?
1N/A
1N/A=item *
1N/A
1N/AHow do I reverse a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I expand tabs in a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I reformat a paragraph?
1N/A
1N/A=item *
1N/A
1N/AHow can I access or change N characters of a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I change the Nth occurrence of something?
1N/A
1N/A=item *
1N/A
1N/AHow can I count the number of occurrences of a substring within a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I capitalize all the words on one line?
1N/A
1N/A=item *
1N/A
1N/AHow can I split a [character] delimited string except when inside [character]?
1N/A
1N/A=item *
1N/A
1N/AHow do I strip blank space from the beginning/end of a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I pad a string with blanks or pad a number with zeroes?
1N/A
1N/A=item *
1N/A
1N/AHow do I extract selected columns from a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I find the soundex value of a string?
1N/A
1N/A=item *
1N/A
1N/AHow can I expand variables in text strings?
1N/A
1N/A=item *
1N/A
1N/AWhat's wrong with always quoting "$vars"?
1N/A
1N/A=item *
1N/A
1N/AWhy don't my E<lt>E<lt>HERE documents work?
1N/A
1N/A=item *
1N/A
1N/AWhat is the difference between a list and an array?
1N/A
1N/A=item *
1N/A
1N/AWhat is the difference between $array[1] and @array[1]?
1N/A
1N/A=item *
1N/A
1N/AHow can I remove duplicate elements from a list or array?
1N/A
1N/A=item *
1N/A
1N/AHow can I tell whether a certain element is contained in a list or array?
1N/A
1N/A=item *
1N/A
1N/AHow do I compute the difference of two arrays? How do I compute the intersection of two arrays?
1N/A
1N/A=item *
1N/A
1N/AHow do I test whether two arrays or hashes are equal?
1N/A
1N/A=item *
1N/A
1N/AHow do I find the first array element for which a condition is true?
1N/A
1N/A=item *
1N/A
1N/AHow do I handle linked lists?
1N/A
1N/A=item *
1N/A
1N/AHow do I handle circular lists?
1N/A
1N/A=item *
1N/A
1N/AHow do I shuffle an array randomly?
1N/A
1N/A=item *
1N/A
1N/AHow do I process/modify each element of an array?
1N/A
1N/A=item *
1N/A
1N/AHow do I select a random element from an array?
1N/A
1N/A=item *
1N/A
1N/AHow do I permute N elements of a list?
1N/A
1N/A=item *
1N/A
1N/AHow do I sort an array by (anything)?
1N/A
1N/A=item *
1N/A
1N/AHow do I manipulate arrays of bits?
1N/A
1N/A=item *
1N/A
1N/AWhy does defined() return true on empty arrays and hashes?
1N/A
1N/A=item *
1N/A
1N/AHow do I process an entire hash?
1N/A
1N/A=item *
1N/A
1N/AWhat happens if I add or remove keys from a hash while iterating over it?
1N/A
1N/A=item *
1N/A
1N/AHow do I look up a hash element by value?
1N/A
1N/A=item *
1N/A
1N/AHow can I know how many entries are in a hash?
1N/A
1N/A=item *
1N/A
1N/AHow do I sort a hash (optionally by value instead of key)?
1N/A
1N/A=item *
1N/A
1N/AHow can I always keep my hash sorted?
1N/A
1N/A=item *
1N/A
1N/AWhat's the difference between "delete" and "undef" with hashes?
1N/A
1N/A=item *
1N/A
1N/AWhy don't my tied hashes make the defined/exists distinction?
1N/A
1N/A=item *
1N/A
1N/AHow do I reset an each() operation part-way through?
1N/A
1N/A=item *
1N/A
1N/AHow can I get the unique keys from two hashes?
1N/A
1N/A=item *
1N/A
1N/AHow can I store a multidimensional array in a DBM file?
1N/A
1N/A=item *
1N/A
1N/AHow can I make my hash remember the order I put elements into it?
1N/A
1N/A=item *
1N/A
1N/AWhy does passing a subroutine an undefined element in a hash create it?
1N/A
1N/A=item *
1N/A
1N/AHow can I make the Perl equivalent of a C structure/C++ class/hash or array of hashes or arrays?
1N/A
1N/A=item *
1N/A
1N/AHow can I use a reference as a hash key?
1N/A
1N/A=item *
1N/A
1N/AHow do I handle binary data correctly?
1N/A
1N/A=item *
1N/A
1N/AHow do I determine whether a scalar is a number/whole/integer/float?
1N/A
1N/A=item *
1N/A
1N/AHow do I keep persistent data across program calls?
1N/A
1N/A=item *
1N/A
1N/AHow do I print out or copy a recursive data structure?
1N/A
1N/A=item *
1N/A
1N/AHow do I define methods for every class/object?
1N/A
1N/A=item *
1N/A
1N/AHow do I verify a credit card checksum?
1N/A
1N/A=item *
1N/A
1N/AHow do I pack arrays of doubles or floats for XS code?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq5>: Files and Formats
1N/A
1N/AI/O and the "f" issues: filehandles, flushing, formats, and footers.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AHow do I flush/unbuffer an output filehandle? Why must I do this?
1N/A
1N/A=item *
1N/A
1N/AHow 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?
1N/A
1N/A=item *
1N/A
1N/AHow do I count the number of lines in a file?
1N/A
1N/A=item *
1N/A
1N/AHow can I use Perl's C<-i> option from within a program?
1N/A
1N/A=item *
1N/A
1N/AHow do I make a temporary file name?
1N/A
1N/A=item *
1N/A
1N/AHow can I manipulate fixed-record-length files?
1N/A
1N/A=item *
1N/A
1N/AHow can I make a filehandle local to a subroutine? How do I pass filehandles between subroutines? How do I make an array of filehandles?
1N/A
1N/A=item *
1N/A
1N/AHow can I use a filehandle indirectly?
1N/A
1N/A=item *
1N/A
1N/AHow can I set up a footer format to be used with write()?
1N/A
1N/A=item *
1N/A
1N/AHow can I write() into a string?
1N/A
1N/A=item *
1N/A
1N/AHow can I output my numbers with commas added?
1N/A
1N/A=item *
1N/A
1N/AHow can I translate tildes (~) in a filename?
1N/A
1N/A=item *
1N/A
1N/AHow come when I open a file read-write it wipes it out?
1N/A
1N/A=item *
1N/A
1N/AWhy do I sometimes get an "Argument list too long" when I use E<lt>*E<gt>?
1N/A
1N/A=item *
1N/A
1N/AIs there a leak/bug in glob()?
1N/A
1N/A=item *
1N/A
1N/AHow can I open a file with a leading ">" or trailing blanks?
1N/A
1N/A=item *
1N/A
1N/AHow can I reliably rename a file?
1N/A
1N/A=item *
1N/A
1N/AHow can I lock a file?
1N/A
1N/A=item *
1N/A
1N/AWhy can't I just open(FH, "E<gt>file.lock")?
1N/A
1N/A=item *
1N/A
1N/AI still don't get locking. I just want to increment the number in the file. How can I do this?
1N/A
1N/A=item *
1N/A
1N/AAll I want to do is append a small amount of text to the end of a file. Do I still have to use locking?
1N/A
1N/A=item *
1N/A
1N/AHow do I randomly update a binary file?
1N/A
1N/A=item *
1N/A
1N/AHow do I get a file's timestamp in perl?
1N/A
1N/A=item *
1N/A
1N/AHow do I set a file's timestamp in perl?
1N/A
1N/A=item *
1N/A
1N/AHow do I print to more than one file at once?
1N/A
1N/A=item *
1N/A
1N/AHow can I read in an entire file all at once?
1N/A
1N/A=item *
1N/A
1N/AHow can I read in a file by paragraphs?
1N/A
1N/A=item *
1N/A
1N/AHow can I read a single character from a file? From the keyboard?
1N/A
1N/A=item *
1N/A
1N/AHow can I tell whether there's a character waiting on a filehandle?
1N/A
1N/A=item *
1N/A
1N/AHow do I do a C<tail -f> in perl?
1N/A
1N/A=item *
1N/A
1N/AHow do I dup() a filehandle in Perl?
1N/A
1N/A=item *
1N/A
1N/AHow do I close a file descriptor by number?
1N/A
1N/A=item *
1N/A
1N/AWhy can't I use "C:\temp\foo" in DOS paths? What doesn't `C:\temp\foo.exe` work?
1N/A
1N/A=item *
1N/A
1N/AWhy doesn't glob("*.*") get all the files?
1N/A
1N/A=item *
1N/A
1N/AWhy does Perl let me delete read-only files? Why does C<-i> clobber protected files? Isn't this a bug in Perl?
1N/A
1N/A=item *
1N/A
1N/AHow do I select a random line from a file?
1N/A
1N/A=item *
1N/A
1N/AWhy do I get weird spaces when I print an array of lines?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq6>: Regular Expressions
1N/A
1N/APattern matching and regular expressions.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AHow can I hope to use regular expressions without creating illegible and unmaintainable code?
1N/A
1N/A=item *
1N/A
1N/AI'm having trouble matching over more than one line. What's wrong?
1N/A
1N/A=item *
1N/A
1N/AHow can I pull out lines between two patterns that are themselves on different lines?
1N/A
1N/A=item *
1N/A
1N/AI put a regular expression into $/ but it didn't work. What's wrong?
1N/A
1N/A=item *
1N/A
1N/AHow do I substitute case insensitively on the LHS while preserving case on the RHS?
1N/A
1N/A=item *
1N/A
1N/AHow can I make C<\w> match national character sets?
1N/A
1N/A=item *
1N/A
1N/AHow can I match a locale-smart version of C</[a-zA-Z]/>?
1N/A
1N/A=item *
1N/A
1N/AHow can I quote a variable to use in a regex?
1N/A
1N/A=item *
1N/A
1N/AWhat is C</o> really for?
1N/A
1N/A=item *
1N/A
1N/AHow do I use a regular expression to strip C style comments from a file?
1N/A
1N/A=item *
1N/A
1N/ACan I use Perl regular expressions to match balanced text?
1N/A
1N/A=item *
1N/A
1N/AWhat does it mean that regexes are greedy? How can I get around it?
1N/A
1N/A=item *
1N/A
1N/AHow do I process each word on each line?
1N/A
1N/A=item *
1N/A
1N/AHow can I print out a word-frequency or line-frequency summary?
1N/A
1N/A=item *
1N/A
1N/AHow can I do approximate matching?
1N/A
1N/A=item *
1N/A
1N/AHow do I efficiently match many regular expressions at once?
1N/A
1N/A=item *
1N/A
1N/AWhy don't word-boundary searches with C<\b> work for me?
1N/A
1N/A=item *
1N/A
1N/AWhy does using $&, $`, or $' slow my program down?
1N/A
1N/A=item *
1N/A
1N/AWhat good is C<\G> in a regular expression?
1N/A
1N/A=item *
1N/A
1N/AAre Perl regexes DFAs or NFAs? Are they POSIX compliant?
1N/A
1N/A=item *
1N/A
1N/AWhat's wrong with using grep or map in a void context?
1N/A
1N/A=item *
1N/A
1N/AHow can I match strings with multibyte characters?
1N/A
1N/A=item *
1N/A
1N/AHow do I match a pattern that is supplied by the user?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq7>: General Perl Language Issues
1N/A
1N/AGeneral Perl language issues that don't clearly fit into any of the
1N/Aother sections.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/ACan I get a BNF/yacc/RE for the Perl language?
1N/A
1N/A=item *
1N/A
1N/AWhat are all these $@%&* punctuation signs, and how do I know when to use them?
1N/A
1N/A=item *
1N/A
1N/ADo I always/never have to quote my strings or use semicolons and commas?
1N/A
1N/A=item *
1N/A
1N/AHow do I skip some return values?
1N/A
1N/A=item *
1N/A
1N/AHow do I temporarily block warnings?
1N/A
1N/A=item *
1N/A
1N/AWhat's an extension?
1N/A
1N/A=item *
1N/A
1N/AWhy do Perl operators have different precedence than C operators?
1N/A
1N/A=item *
1N/A
1N/AHow do I declare/create a structure?
1N/A
1N/A=item *
1N/A
1N/AHow do I create a module?
1N/A
1N/A=item *
1N/A
1N/AHow do I create a class?
1N/A
1N/A=item *
1N/A
1N/AHow can I tell if a variable is tainted?
1N/A
1N/A=item *
1N/A
1N/AWhat's a closure?
1N/A
1N/A=item *
1N/A
1N/AWhat is variable suicide and how can I prevent it?
1N/A
1N/A=item *
1N/A
1N/AHow can I pass/return a {Function, FileHandle, Array, Hash, Method, Regex}?
1N/A
1N/A=item *
1N/A
1N/AHow do I create a static variable?
1N/A
1N/A=item *
1N/A
1N/AWhat's the difference between dynamic and lexical (static) scoping? Between local() and my()?
1N/A
1N/A=item *
1N/A
1N/AHow can I access a dynamic variable while a similarly named lexical is in scope?
1N/A
1N/A=item *
1N/A
1N/AWhat's the difference between deep and shallow binding?
1N/A
1N/A=item *
1N/A
1N/AWhy doesn't "my($foo) = E<lt>FILEE<gt>;" work right?
1N/A
1N/A=item *
1N/A
1N/AHow do I redefine a builtin function, operator, or method?
1N/A
1N/A=item *
1N/A
1N/AWhat's the difference between calling a function as &foo and foo()?
1N/A
1N/A=item *
1N/A
1N/AHow do I create a switch or case statement?
1N/A
1N/A=item *
1N/A
1N/AHow can I catch accesses to undefined variables, functions, or methods?
1N/A
1N/A=item *
1N/A
1N/AWhy can't a method included in this same file be found?
1N/A
1N/A=item *
1N/A
1N/AHow can I find out my current package?
1N/A
1N/A=item *
1N/A
1N/AHow can I comment out a large block of perl code?
1N/A
1N/A=item *
1N/A
1N/AHow do I clear a package?
1N/A
1N/A=item *
1N/A
1N/AHow can I use a variable as a variable name?
1N/A
1N/A=item *
1N/A
1N/AWhat does "bad interpreter" mean?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq8>: System Interaction
1N/A
1N/AInterprocess communication (IPC), control over the user-interface
1N/A(keyboard, screen and pointing devices).
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AHow do I find out which operating system I'm running under?
1N/A
1N/A=item *
1N/A
1N/AHow come exec() doesn't return?
1N/A
1N/A=item *
1N/A
1N/AHow do I do fancy stuff with the keyboard/screen/mouse?
1N/A
1N/A=item *
1N/A
1N/AHow do I print something out in color?
1N/A
1N/A=item *
1N/A
1N/AHow do I read just one key without waiting for a return key?
1N/A
1N/A=item *
1N/A
1N/AHow do I check whether input is ready on the keyboard?
1N/A
1N/A=item *
1N/A
1N/AHow do I clear the screen?
1N/A
1N/A=item *
1N/A
1N/AHow do I get the screen size?
1N/A
1N/A=item *
1N/A
1N/AHow do I ask the user for a password?
1N/A
1N/A=item *
1N/A
1N/AHow do I read and write the serial port?
1N/A
1N/A=item *
1N/A
1N/AHow do I decode encrypted password files?
1N/A
1N/A=item *
1N/A
1N/AHow do I start a process in the background?
1N/A
1N/A=item *
1N/A
1N/AHow do I trap control characters/signals?
1N/A
1N/A=item *
1N/A
1N/AHow do I modify the shadow password file on a Unix system?
1N/A
1N/A=item *
1N/A
1N/AHow do I set the time and date?
1N/A
1N/A=item *
1N/A
1N/AHow can I sleep() or alarm() for under a second?
1N/A
1N/A=item *
1N/A
1N/AHow can I measure time under a second?
1N/A
1N/A=item *
1N/A
1N/AHow can I do an atexit() or setjmp()/longjmp()? (Exception handling)
1N/A
1N/A=item *
1N/A
1N/AWhy doesn't my sockets program work under System V (Solaris)? What does the error message "Protocol not supported" mean?
1N/A
1N/A=item *
1N/A
1N/AHow can I call my system's unique C functions from Perl?
1N/A
1N/A=item *
1N/A
1N/AWhere do I get the include files to do ioctl() or syscall()?
1N/A
1N/A=item *
1N/A
1N/AWhy do setuid perl scripts complain about kernel problems?
1N/A
1N/A=item *
1N/A
1N/AHow can I open a pipe both to and from a command?
1N/A
1N/A=item *
1N/A
1N/AWhy can't I get the output of a command with system()?
1N/A
1N/A=item *
1N/A
1N/AHow can I capture STDERR from an external command?
1N/A
1N/A=item *
1N/A
1N/AWhy doesn't open() return an error when a pipe open fails?
1N/A
1N/A=item *
1N/A
1N/AWhat's wrong with using backticks in a void context?
1N/A
1N/A=item *
1N/A
1N/AHow can I call backticks without shell processing?
1N/A
1N/A=item *
1N/A
1N/AWhy can't my script read from STDIN after I gave it EOF (^D on Unix, ^Z on MS-DOS)?
1N/A
1N/A=item *
1N/A
1N/AHow can I convert my shell script to perl?
1N/A
1N/A=item *
1N/A
1N/ACan I use perl to run a telnet or ftp session?
1N/A
1N/A=item *
1N/A
1N/AHow can I write expect in Perl?
1N/A
1N/A=item *
1N/A
1N/AIs there a way to hide perl's command line from programs such as "ps"?
1N/A
1N/A=item *
1N/A
1N/AI {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?
1N/A
1N/A=item *
1N/A
1N/AHow do I close a process's filehandle without waiting for it to complete?
1N/A
1N/A=item *
1N/A
1N/AHow do I fork a daemon process?
1N/A
1N/A=item *
1N/A
1N/AHow do I find out if I'm running interactively or not?
1N/A
1N/A=item *
1N/A
1N/AHow do I timeout a slow event?
1N/A
1N/A=item *
1N/A
1N/AHow do I set CPU limits?
1N/A
1N/A=item *
1N/A
1N/AHow do I avoid zombies on a Unix system?
1N/A
1N/A=item *
1N/A
1N/AHow do I use an SQL database?
1N/A
1N/A=item *
1N/A
1N/AHow do I make a system() exit on control-C?
1N/A
1N/A=item *
1N/A
1N/AHow do I open a file without blocking?
1N/A
1N/A=item *
1N/A
1N/AHow do I install a module from CPAN?
1N/A
1N/A=item *
1N/A
1N/AWhat's the difference between require and use?
1N/A
1N/A=item *
1N/A
1N/AHow do I keep my own module/library directory?
1N/A
1N/A=item *
1N/A
1N/AHow do I add the directory my program lives in to the module/library search path?
1N/A
1N/A=item *
1N/A
1N/AHow do I add a directory to my include path at runtime?
1N/A
1N/A=item *
1N/A
1N/AWhat is socket.ph and where do I get it?
1N/A
1N/A=back
1N/A
1N/A
1N/A=head2 L<perlfaq9>: Networking
1N/A
1N/ANetworking, the internet, and a few on the web.
1N/A
1N/A=over 4
1N/A
1N/A=item *
1N/A
1N/AWhat is the correct form of response from a CGI script?
1N/A
1N/A=item *
1N/A
1N/AMy CGI script runs from the command line but not the browser. (500 Server Error)
1N/A
1N/A=item *
1N/A
1N/AHow can I get better error messages from a CGI program?
1N/A
1N/A=item *
1N/A
1N/AHow do I remove HTML from a string?
1N/A
1N/A=item *
1N/A
1N/AHow do I extract URLs?
1N/A
1N/A=item *
1N/A
1N/AHow do I download a file from the user's machine? How do I open a file on another machine?
1N/A
1N/A=item *
1N/A
1N/AHow do I make a pop-up menu in HTML?
1N/A
1N/A=item *
1N/A
1N/AHow do I fetch an HTML file?
1N/A
1N/A=item *
1N/A
1N/AHow do I automate an HTML form submission?
1N/A
1N/A=item *
1N/A
1N/AHow do I decode or create those %-encodings on the web?
1N/A
1N/A=item *
1N/A
1N/AHow do I redirect to another page?
1N/A
1N/A=item *
1N/A
1N/AHow do I put a password on my web pages?
1N/A
1N/A=item *
1N/A
1N/AHow do I edit my .htpasswd and .htgroup files with Perl?
1N/A
1N/A=item *
1N/A
1N/AHow do I make sure users can't enter values into a form that cause my CGI script to do bad things?
1N/A
1N/A=item *
1N/A
1N/AHow do I parse a mail header?
1N/A
1N/A=item *
1N/A
1N/AHow do I decode a CGI form?
1N/A
1N/A=item *
1N/A
1N/AHow do I check a valid mail address?
1N/A
1N/A=item *
1N/A
1N/AHow do I decode a MIME/BASE64 string?
1N/A
1N/A=item *
1N/A
1N/AHow do I return the user's mail address?
1N/A
1N/A=item *
1N/A
1N/AHow do I send mail?
1N/A
1N/A=item *
1N/A
1N/AHow do I use MIME to make an attachment to a mail message?
1N/A
1N/A=item *
1N/A
1N/AHow do I read mail?
1N/A
1N/A=item *
1N/A
1N/AHow do I find out my hostname/domainname/IP address?
1N/A
1N/A=item *
1N/A
1N/AHow do I fetch a news article or the active newsgroups?
1N/A
1N/A=item *
1N/A
1N/AHow do I fetch/put an FTP file?
1N/A
1N/A=item *
1N/A
1N/AHow can I do RPC in Perl?
1N/A
1N/A=back
1N/A
1N/A