=head1 NAME
-perlfaq - frequently asked questions about Perl ($Date: 2003/01/03 20:00:25 $)
+perlfaq - frequently asked questions about Perl ($Date: 2005/03/27 07:21:21 $)
=head1 DESCRIPTION
=head1 Author and Copyright Information
-Copyright (c) 1997-2003 Tom Christiansen, Nathan Torkington, and
+Copyright (c) 1997-2005 Tom Christiansen, Nathan Torkington, and
other contributors noted in the answers.
All rights reserved.
=head1 Table of Contents
-=head2 perlfaq: Structural overview of the FAQ.
+=over 4
+
+=item perlfaq - this document
+
+=item perlfaq1 - General Questions About Perl
+
+=item perlfaq2 - Obtaining and Learning about Perl
+
+=item perlfaq3 - Programming Tools
+
+=item perlfaq4 - Data Manipulation
+
+=item perlfaq5 - Files and Formats
+
+=item perlfaq6 - Regular Expressions
+
+=item perlfaq7 - General Perl Language Issues
+
+=item perlfaq8 - System Interaction
+
+=item perlfaq9 - Networking
+
+
+=back
+
+
+=head1 The Questions
-This document.
=head2 L<perlfaq1>: General Questions About Perl
=item *
-What are perl4 and perl5?
+What are perl4, perl5, or perl6?
+
+=item *
+
+What is Ponie?
=item *
=head2 L<perlfaq2>: Obtaining and Learning about Perl
-Where to find source and documentation for Perl, support,
-and related matters.
+Where to find source and documentation for Perl, support, and related matters.
=over 4
=item *
-How can I generate simple menus without using CGI or Tk?
-
-=item *
-
How can I make my Perl program run faster?
=item *
=item *
-I've read perlembed, perlguts, etc., but I can't embed perl in
-my C program; what am I doing wrong?
+I've read perlembed, perlguts, etc., but I can't embed perl in my C program; what am I doing wrong?
=item *
=head2 L<perlfaq4>: Data Manipulation
-Manipulating numbers, dates, strings, arrays, hashes, and
-miscellaneous data issues.
+Manipulating numbers, dates, strings, arrays, hashes, and miscellaneous data issues.
=over 4
=item *
+Why is C<int()> broken?
+
+=item *
+
Why isn't my octal data interpreted correctly?
=item *
-Does Perl have a round() function? What about ceil() and floor()? Trig functions?
+Does Perl have a C<round()> function? What about C<ceil()> and C<floor()>? Trig functions?
=item *
-How do I convert between numeric representations?
+How do I convert between numeric representations/bases/radixes?
=item *
=item *
-How do I find the week-of-the-year/day-of-the-year?
+How do I find the day or week of the year?
=item *
=item *
-Why don't my <<HERE documents work?
+Why don't my E<lt>E<lt>HERE documents work?
=item *
=item *
-What is the difference between $array[1] and @array[1]?
+What is the difference between C<$array[1]> and C<@array[1]>?
=item *
=item *
-Why does defined() return true on empty arrays and hashes?
+Why does C<defined()> return true on empty arrays and hashes?
=item *
=item *
-How do I reset an each() operation part-way through?
+How do I reset an C<each()> operation part-way through?
=item *
=item *
+How can I copy a file?
+
+=item *
+
How do I make a temporary file name?
=item *
=item *
-How can I set up a footer format to be used with write()?
+How can I set up a footer format to be used with C<write()>?
=item *
-How can I write() into a string?
+How can I C<write()> into a string?
=item *
=item *
-Why do I sometimes get an "Argument list too long" when I use <*>?
+Why do I sometimes get an "Argument list too long" when I use E<lt>*E<gt>?
=item *
-Is there a leak/bug in glob()?
+Is there a leak/bug in C<glob()>?
=item *
=item *
-Why can't I just open(FH, ">file.lock")?
+Why can't I just C<< open(FH, ">file.lock") >>?
=item *
=item *
-How do I dup() a filehandle in Perl?
+How do I C<dup()> a filehandle in Perl?
=item *
=item *
-Why can't I use "C:\temp\foo" in DOS paths? What doesn't `C:\temp\foo.exe` work?
+Why can't I use "C:\temp\foo" in DOS paths? Why doesn't `C:\temp\foo.exe` work?
=item *
-Why doesn't glob("*.*") get all the files?
+Why doesn't C<glob("*.*")> get all the files?
=item *
=head2 L<perlfaq6>: Regular Expressions
-Pattern matching and regular expressions.
+This section is surprisingly small because the rest of the FAQ is
+littered with answers involving regular expressions. For example,
+decoding a URL and checking whether something is a number are handled
+with regular expressions, but those answers are found elsewhere in this
+document (in L<perlfaq9>: "How do I decode or create those %-encodings
+on the web" and L<perlfaq4>: "How do I determine whether a scalar is
+a number/whole/integer/float", to be precise).
=over 4
=item *
-I put a regular expression into $/ but it didn't work. What's wrong?
+I put a regular expression into C<$/> but it didn't work. What's wrong?
=item *
=item *
-Why does using $&, $`, or $' slow my program down?
+Why does using C<$&>, C<$`>, or C<$'> slow my program down?
=item *
=item *
-What's wrong with using grep or map in a void context?
+What's wrong with using grep in a void context?
=item *
=head2 L<perlfaq7>: General Perl Language Issues
-General Perl language issues that don't clearly fit into any of the
-other sections.
+General Perl language issues that don't clearly fit into any of the other sections.
=over 4
=item *
-Why doesn't "my($foo) = <FILE>;" work right?
+Why doesn't C<< my($foo) = <FILE>; >> work right?
=item *
=item *
-What's the difference between calling a function as &foo and foo()?
+What's the difference between calling a function as C<&foo> and C<foo()>?
=item *
How can I use a variable as a variable name?
+=item *
+
+What does "bad interpreter" mean?
+
=back
=head2 L<perlfaq8>: System Interaction
-Interprocess communication (IPC), control over the user-interface
-(keyboard, screen and pointing devices).
+This section of the Perl FAQ covers questions involving operating system interaction. Topics include interprocess communication (IPC), 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, L<perlvms>, L<perlplan9>, ...). These should contain more detailed information on the vagaries of your perl.
=over 4
=item *
-How come exec() doesn't return?
+How come C<exec()> doesn't return?
=item *
=item *
-How can I sleep() or alarm() for under a second?
+How can I C<sleep()> or C<alarm()> for under a second?
=item *
=item *
-How can I do an atexit() or setjmp()/longjmp()? (Exception handling)
+How can I do an C<atexit()> or C<setjmp()>/C<longjmp()>? (Exception handling)
=item *
=item *
-Where do I get the include files to do ioctl() or syscall()?
+Where do I get the include files to do C<ioctl()> or C<syscall()>?
=item *
=item *
-Why can't I get the output of a command with system()?
+Why can't I get the output of a command with C<system()>?
=item *
=item *
-Why doesn't open() return an error when a pipe open fails?
+Why doesn't C<open()> return an error when a pipe open fails?
=item *
=item *
-I {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?
+I {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?
=item *
=item *
-How do I make a system() exit on control-C?
+How do I make a C<system()> exit on control-C?
=item *
=item *
+How do I tell the difference between errors from the shell and perl?
+
+=item *
+
How do I install a module from CPAN?
=item *
=item *
-How do I add a directory to my include path at runtime?
+How do I add a directory to my include path (C<@INC>) at runtime?
=item *
-What is socket.ph and where do I get it?
+What is F<socket.ph> and where do I get it?
=back
=item *
-How do I edit my .htpasswd and .htgroup files with Perl?
+How do I edit my F<.htpasswd> and F<.htgroup> files with Perl?
=item *