within eval or require. (Fixing these is non-trivial, unfortunately, but
they must be fixed eventually.)
-=head1 Common Gotcha's
+=head1 Common Gotchas
=over 4
On WinNT with either the I<ntea> or I<ntsec> C<CYGWIN> settings, directory
and file permissions may not be set correctly. Since the build process
-creates directories and files, to be safe you may want to run a `C<chmod
--R +w *>' on the entire Perl source tree.
+creates directories and files, to be safe you may want to run a
+C<chmod -R +w *> on the entire Perl source tree.
Also, it is a well known WinNT "feature" that files created by a login
that is a member of the I<Administrators> group will be owned by the
=item * I<dlsym()>
I<ld2> is needed to build dynamic libraries, but it does not exist
-when C<dlsym()> checking occurs (it is not created until `C<make>' runs).
+when C<dlsym()> checking occurs (it is not created until C<make> runs).
You will see the following message:
Checking whether your C<dlsym()> needs a leading underscore ...
=head2 ld2 on Cygwin
-During `C<make>', I<ld2> will be created and installed in your $installbin
+During C<make>, I<ld2> will be created and installed in your $installbin
directory (where you said to put public executables). It does not
-wait until the `C<make install>' process to install the I<ld2> script,
-this is because the remainder of the `C<make>' refers to I<ld2> without
+wait until the C<make install> process to install the I<ld2> script,
+this is because the remainder of the C<make> refers to I<ld2> without
fully specifying its path and does this from multiple subdirectories.
The assumption is that $installbin is in your current C<PATH>. If this
-is not the case `C<make>' will fail at some point. If this happens,
+is not the case C<make> will fail at some point. If this happens,
just manually copy I<ld2> from the source directory to somewhere in
your C<PATH>.
cd t;./perl harness 2>&1 | tee ../log.harness
The same tests are run both times, but more information is provided when
-running as `C<./perl harness>'.
+running as C<./perl harness>.
Test results vary depending on your host system and your Cygwin
configuration. If a test can pass in some Cygwin setup, it is always
make install 2>&1 | tee log.make-install
-NOTE: If C<STDERR> is redirected `C<make install>' will B<not> prompt
+NOTE: If C<STDERR> is redirected C<make install> will B<not> prompt
you to install I<perl> into F</usr/bin>.
-You may need to be I<Administrator> to run `C<make install>'. If you
+You may need to be I<Administrator> to run C<make install>. If you
are not, you must have write access to the directories in question.
Information on installing the Perl documentation in HTML format can be
If you want to use Perl on the Hurd, I recommend using the Debian
GNU/Hurd distribution ( see http://www.debian.org/ ), even if an
-official, stable release has not yet been made. The old `gnu-0.2'
+official, stable release has not yet been made. The old "gnu-0.2"
binary distribution will most certainly have additional problems.
=head2 Known Problems with Perl on Hurd
The Perl test suite may still report some errors on the Hurd. The
-`lib/anydbm' and `pragma/warnings' tests will almost certainly fail.
+"lib/anydbm" and "pragma/warnings" tests will almost certainly fail.
Both failures are not really specific to the Hurd, as indicated by the
test suite output.
The socket tests may fail if the network is not configured. You have
-to make `/hurd/pfinet' the translator for `/servers/socket/2', giving
-it the right arguments. Try `/hurd/pfinet --help' for more
+to make "/hurd/pfinet" the translator for "/servers/socket/2", giving
+it the right arguments. Try "/hurd/pfinet --help" for more
information.
Here are the statistics for Perl 5.005_62 on my system:
However, since I am running a very recent Hurd snapshot, in which a lot of
bugs that were exposed by the Perl test suite have been fixed, you may
-encounter more failures. Likely candidates are: `op/stat', `lib/io_pipe',
-`lib/io_sock', `lib/io_udp' and `lib/time'.
+encounter more failures. Likely candidates are: "op/stat", "lib/io_pipe",
+"lib/io_sock", "lib/io_udp" and "lib/time".
In any way, if you're seeing failures beyond those mentioned in this
document, please consider upgrading to the latest Hurd before reporting
memory for cc1, 3 would reserve three fourths. You will have
to find out the value that suits to your system yourself.
-To find out the location of the program `cc1' simply type
+To find out the location of the program "cc1" simply type
`gcc --print-prog-name cc1' at your shell prompt.
Now run make (maybe "make -k"). If you get a fatal signal 10
_C89_CCMODE=1 is also a good idea for users of GNU make).
You might also want to have GNU groff for OS/390 installed before
-running the `make install` step for Perl.
+running the "make install" step for Perl.
There is a syntax error in the /usr/include/sys/socket.h header file
that IBM supplies with USS V2R7, V2R8, and possibly V2R9. The problem with
=head2 Testing Anomalies with Perl on OS/390
-The `make test` step runs a Perl Verification Procedure, usually before
+The "make test" step runs a Perl Verification Procedure, usually before
installation. You might encounter STDERR messages even during a successful
-run of `make test`. Here is a guide to some of the more commonly seen
+run of "make test". Here is a guide to some of the more commonly seen
anomalies:
=over 4
If you've downloaded the binary distribution, it needs to be
installed below /usr/local. Source code distributions have an
-automated `make install` step that means you do not need to extract
+automated "make install" step that means you do not need to extract
the source code below /usr/local (though that is where it will be
installed by default). You may need to worry about the networking
configuration files discussed in the last bullet below.
=head2 Testing Anomalies of Perl on VM/ESA
-The `make test` step runs a Perl Verification Procedure, usually before
+The "make test" step runs a Perl Verification Procedure, usually before
installation. As the 5.6.1 kit was being assembled
the following "failures" were known to appear on some machines
-during `make test` (mostly due to ASCII vs. EBCDIC conflicts),
+during "make test" (mostly due to ASCII vs. EBCDIC conflicts),
your results may differ:
[the list of failures being compiled]
=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.
=item *
-Why is int() broken?
+Why is C<int()> broken?
=item *
=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 *
=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 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 *
-Is there a leak/bug in glob()?
+Is there a leak/bug in C<glob()>?
=item *
=item *
-Why can't I just open(FH, "E<gt>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 doesn't glob("*.*") get all the files?
+Why doesn't C<glob("*.*")> get all the files?
=item *
=head2 L<perlfaq6>: 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).
+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 *
-Why doesn't "my($foo) = E<lt>FILEE<gt>;" 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 *
=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 add a directory to my include path (@INC) 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 *
=head2 How can I use Perl interactively?
The typical approach uses the Perl debugger, described in the
-perldebug(1) manpage, on an ``empty'' program, like this:
+perldebug(1) manpage, on an "empty" program, like this:
perl -de 42
and profile to make sure you're optimizing the right part, look for
better algorithms instead of microtuning your code, and when all else
fails consider just buying faster hardware. You will probably want to
-read the answer to the earlier question ``How do I profile my Perl
-programs?'' if you haven't done so already.
+read the answer to the earlier question "How do I profile my Perl
+programs?" if you haven't done so already.
A different approach is to autoload seldom-used Perl code. See the
AutoSplit and AutoLoader modules in the standard distribution for
See http://www.cpan.org/modules/by-category/15_World_Wide_Web_HTML_HTTP_CGI/ .
-A non-free, commercial product, ``The Velocity Engine for Perl'',
-(http://www.binevolve.com/ or http://www.binevolve.com/velocigen/ )
-might also be worth looking at. It will allow you to increase the
-performance of your Perl programs, running programs up to 25 times
-faster than normal CGI Perl when running in persistent Perl mode or 4
-to 5 times faster without any modification to your existing CGI
-programs. Fully functional evaluation copies are available from the
-web site.
-
=head2 How can I hide the source for my Perl program?
Delete it. :-) Seriously, there are a number of (mostly
-unsatisfactory) solutions with varying levels of ``security''.
+unsatisfactory) solutions with varying levels of "security".
First of all, however, you I<can't> take away read permission, because
the source code has to be readable in order to be compiled and
If you're concerned about people profiting from your code, then the
bottom line is that nothing but a restrictive license will give you
legal security. License your software and pepper it with threatening
-statements like ``This is unpublished proprietary software of XYZ Corp.
+statements like "This is unpublished proprietary software of XYZ Corp.
Your access to it does not give you permission to use it blah blah
-blah.'' We are not lawyers, of course, so you should see a lawyer if
+blah." We are not lawyers, of course, so you should see a lawyer if
you want to be sure your license's wording will stand up in court.
=head2 How can I compile my Perl program into byte code or C?
extproc perl -S -your_switches
as the first line in C<*.cmd> file (C<-S> due to a bug in cmd.exe's
-`extproc' handling). For DOS one should first invent a corresponding
+"extproc" handling). For DOS one should first invent a corresponding
batch file and codify it in C<ALTERNATE_SHEBANG> (see the
F<dosish.h> file in the source distribution for more information).
For modules, get the CGI or LWP modules from CPAN. For textbooks,
see the two especially dedicated to web stuff in the question on
-books. For problems and questions related to the web, like ``Why
-do I get 500 Errors'' or ``Why doesn't it run from the browser right
-when it runs fine on the command line'', see the troubleshooting
+books. For problems and questions related to the web, like "Why
+do I get 500 Errors" or "Why doesn't it run from the browser right
+when it runs fine on the command line", see the troubleshooting
guides and references in L<perlfaq9> or in the CGI MetaFAQ:
http://www.perl.org/CGI_MetaFAQ.html
(despite appearances caused by bugs in your programs :-). see the
F<random> article in the "Far More Than You Ever Wanted To Know"
collection in http://www.cpan.org/misc/olddoc/FMTEYEWTK.tgz , courtesy of
-Tom Phoenix, talks more about this. John von Neumann said, ``Anyone
+Tom Phoenix, talks more about this. John von Neumann said, "Anyone
who attempts to generate random numbers by deterministic means is, of
-course, living in a state of sin.''
+course, living in a state of sin."
If you want numbers that are more random than C<rand> with C<srand>
provides, you should also check out the Math::TrulyRandom module from
CPAN. It uses the imperfections in your system's timer to generate
random numbers, but this takes quite a while. If you want a better
pseudorandom generator than comes with your operating system, look at
-``Numerical Recipes in C'' at http://www.nr.com/ .
+"Numerical Recipes in C" at http://www.nr.com/ .
=head2 How do I get a random number between X and Y?
That doesn't mean that Perl can't be used to create non-Y2K compliant
programs. It can. But so can your pencil. It's the fault of the user,
-not the language. At the risk of inflaming the NRA: ``Perl doesn't
-break Y2K, people do.'' See http://www.perl.org/about/y2k.html for
+not the language. At the risk of inflaming the NRA: "Perl doesn't
+break Y2K, people do." See http://www.perl.org/about/y2k.html for
a longer exposition.
=head1 Data: Strings
=head2 How do I unescape a string?
-It depends just what you mean by ``escape''. URL escapes are dealt
+It depends just what you mean by "escape". URL escapes are dealt
with in L<perlfaq9>. Shell escapes with the backslash (C<\>)
character are removed with
wrapper function for more convenient access. This function takes
a string and returns the number it found, or C<undef> for input that
isn't a C float. The C<is_numeric> function is a front end to C<getnum>
-if you just want to say, ``Is this a float?''
+if you just want to say, "Is this a float?"
sub getnum {
use POSIX qw(strtod);
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).
+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).
=head2 How can I hope to use regular expressions without creating illegible and unmaintainable code?
print "$count $line";
}
-If you want these output in a sorted order, see L<perlfaq4>: ``How do I
-sort a hash (optionally by value instead of key)?''.
+If you want these output in a sorted order, see L<perlfaq4>: "How do I
+sort a hash (optionally by value instead of key)?".
=head2 How can I do approximate matching?
Here are a few ways, all painful, to deal with it:
- $martian =~ s/([A-Z][A-Z])/ $1 /g; # Make sure adjacent ``martian''
+ $martian =~ s/([A-Z][A-Z])/ $1 /g; # Make sure adjacent "martian"
# bytes are no longer adjacent.
print "found GX!\n" if $martian =~ /GX/;
objects. See L<perlsub/"Pass by Reference"> for this particular
question, and L<perlref> for information on references.
-See ``Passing Regexes'', below, for information on passing regular
+See "Passing Regexes", below, for information on passing regular
expressions.
=over 4
If you expect characters to get to your device when you print() them,
you'll want to autoflush that filehandle. You can use select()
and the C<$|> variable to control autoflushing (see L<perlvar/$E<verbar>>
-and L<perlfunc/select>, or L<perlfaq5>, ``How do I flush/unbuffer an
-output filehandle? Why must I do this?''):
+and L<perlfunc/select>, or L<perlfaq5>, "How do I flush/unbuffer an
+output filehandle? Why must I do this?"):
$oldh = select(DEV);
$| = 1;
generates a signal which is sent to your terminal's currently
foregrounded process group, which you then trap in your process.
Signals are documented in L<perlipc/"Signals"> and the
-section on ``Signals'' in the Camel.
+section on "Signals" in the Camel.
You can set the values of the %SIG hash to be the functions you want
to handle the signal. After perl catches the signal, it looks in %SIG
Perl's exception-handling mechanism is its eval() operator. You can
use eval() as setjmp and die() as longjmp. For details of this, see
the section on signals, especially the time-out handler for a blocking
-flock() in L<perlipc/"Signals"> or the section on ``Signals'' in
+flock() in L<perlipc/"Signals"> or the section on "Signals" in
the Camel Book.
If exception handling is all you're interested in, try the
Use the alarm() function, probably in conjunction with a signal
handler, as documented in L<perlipc/"Signals"> and the section on
-``Signals'' in the Camel. You may instead use the more flexible
+"Signals" in the Camel. You may instead use the more flexible
Sys::AlarmCall module available from CPAN.
The alarm() function is not implemented on all versions of Windows.
get a new F<perl> binary with your extension linked in.
See L<ExtUtils::MakeMaker> for more details on building extensions.
-See also the next question, ``What's the difference between require
-and use?''.
+See also the next question, "What's the difference between require
+and use?".
=head2 What's the difference between require and use?
consistent OO interface to these files, regardless of how they're
stored. Databases may be text, dbm, Berkeley DB or any database with
a DBI compatible driver. HTTPD::UserAdmin supports files used by the
-`Basic' and `Digest' authentication schemes. Here's an example:
+"Basic" and "Digest" authentication schemes. Here's an example:
use HTTPD::UserAdmin ();
HTTPD::UserAdmin
(personal ID number). Record the address and PIN (best that it be a
random one) for later processing. In the mail you send, ask them to
include the PIN in their reply. But if it bounces, or the message is
-included via a ``vacation'' script, it'll be there anyway. So it's
+included via a "vacation" script, it'll be there anyway. So it's
best to ask them to mail back a slight alteration of the PIN, such as
with the characters reversed, one added or subtracted to each digit, etc.
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19yy name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type "show w".
This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
+ under certain conditions; type "show c" for details.
-The hypothetical commands `show w' and `show c' should show the appropriate
+The hypothetical commands "show w" and "show c" should show the appropriate
parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
+be called something other than "show w" and "show c"; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
+ "Gnomovision" (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
Over this group of porters presides Larry Wall. He has the final word
in what does and does not change in the Perl language. Various
-releases of Perl are shepherded by a ``pumpking'', a porter
-responsible for gathering patches, deciding on a patch-by-patch
+releases of Perl are shepherded by a "pumpking", a porter
+responsible for gathering patches, deciding on a patch-by-patch,
feature-by-feature basis what will and will not go into the release.
For instance, Gurusamy Sarathy was the pumpking for the 5.6 release of
Perl, and Jarkko Hietaniemi was the pumpking for the 5.8 release, and
-Hugo van der Sanden and Rafael Garcia-Suarez share the pumpking for
+Hugo van der Sanden and Rafael Garcia-Suarez share the pumpking crown for
the 5.10 release.
In addition, various people are pumpkings for different things. For
or would it be broadly useful? Sometimes, instead of adding a feature
with a tight focus, the porters might decide to wait until someone
implements the more generalized feature. For instance, instead of
-implementing a ``delayed evaluation'' feature, the porters are waiting
+implementing a "delayed evaluation" feature, the porters are waiting
for a macro system that would permit delayed evaluation and much more.
=item Does it potentially introduce new bugs?
=item Is there another way to do it?
-Larry said ``Although the Perl Slogan is I<There's More Than One Way
-to Do It>, I hesitate to make 10 ways to do something''. This is a
+Larry said "Although the Perl Slogan is I<There's More Than One Way
+to Do It>, I hesitate to make 10 ways to do something". This is a
tricky heuristic to navigate, though--one man's essential addition is
another man's pointless cruft.
Working code is always preferred to pie-in-the-sky ideas. A patch to
add a feature stands a much higher chance of making it to the language
than does a random feature request, no matter how fervently argued the
-request might be. This ties into ``Will it be useful?'', as the fact
+request might be. This ties into "Will it be useful?", as the fact
that someone took the time to make the patch demonstrates a strong
desire for the feature.
=back
-If you're on the list, you might hear the word ``core'' bandied
-around. It refers to the standard distribution. ``Hacking on the
-core'' means you're changing the C source code to the Perl
-interpreter. ``A core module'' is one that ships with Perl.
+If you're on the list, you might hear the word "core" bandied
+around. It refers to the standard distribution. "Hacking on the
+core" means you're changing the C source code to the Perl
+interpreter. "A core module" is one that ships with Perl.
=head2 Keeping in sync
=item rsync'ing the source tree
Presuming you are in the directory where your perl source resides
-and you have rsync installed and available, you can `upgrade' to
+and you have rsync installed and available, you can "upgrade" to
the bleadperl using:
# rsync -avz rsync://ftp.linux.activestate.com/perl-current/ .
C<yyparse>, the parser, lives in F<perly.c>, although you're better off
reading the original YACC input in F<perly.y>. (Yes, Virginia, there
B<is> a YACC grammar for Perl!) The job of the parser is to take your
-code and `understand' it, splitting it into sentences, deciding which
+code and "understand" it, splitting it into sentences, deciding which
operands go with which operators and so on.
The parser is nobly assisted by the lexer, which chunks up your input
execution if required.
The actual functions called are known as PP code, and they're spread
-between four files: F<pp_hot.c> contains the `hot' code, which is most
+between four files: F<pp_hot.c> contains the "hot" code, which is most
often used and highly optimized, F<pp_sys.c> contains all the
system-specific functions, F<pp_ctl.c> contains the functions which
implement control structures (C<if>, C<while> and the like) and F<pp.c>
fed certain things by the tokeniser, which generally end up in upper
case. Here, C<ADDOP>, is provided when the tokeniser sees C<+> in your
code. C<ASSIGNOP> is provided when C<=> is used for assigning. These are
-`terminal symbols', because you can't get any simpler than them.
+"terminal symbols", because you can't get any simpler than them.
The grammar, lines one and three of the snippet above, tells you how to
-build up more complex forms. These complex forms, `non-terminal symbols'
+build up more complex forms. These complex forms, "non-terminal symbols"
are generally placed in lower case. C<term> here is a non-terminal
symbol, representing a single expression.
C<newBINOP>, a function in F<op.c>, is the op type. It's an addition
operator, so we want the type to be C<ADDOP>. We could specify this
directly, but it's right there as the second token in the input, so we
-use C<$2>. The second parameter is the op's flags: 0 means `nothing
-special'. Then the things to add: the left and right hand side of our
+use C<$2>. The second parameter is the op's flags: 0 means "nothing
+special". Then the things to add: the left and right hand side of our
expression, in scalar context.
=head2 Stacks
=item Mark stack
-I say `your portion of the stack' above because PP code doesn't
+I say "your portion of the stack" above because PP code doesn't
necessarily get the whole stack to itself: if your function calls
another function, you'll only want to expose the arguments aimed for the
called function, and not (necessarily) let it get at your own data. The
-way we do this is to have a `virtual' bottom-of-stack, exposed to each
+way we do this is to have a "virtual" bottom-of-stack, exposed to each
function. The mark stack keeps bookmarks to locations in the argument
stack usable by each function. For instance, when dealing with a tied
-variable, (internally, something with `P' magic) Perl has to call
+variable, (internally, something with "P" magic) Perl has to call
methods for accesses to the tied variables. However, we need to separate
the arguments exposed to the method to the argument exposed to the
original function - the store or fetch or whatever it may be. Here's how
which will just restart. That means you have to C<die> to longjump(3) out
of the handler. Even this is a little cavalier for the true paranoiac,
who avoids C<die> in a handler because the system I<is> out to get you.
-The pragmatic approach was to say ``I know the risks, but prefer the
-convenience'', and to do anything you wanted in your signal handler,
+The pragmatic approach was to say "I know the risks, but prefer the
+convenience", and to do anything you wanted in your signal handler,
and be prepared to clean up core dumps now and again.
In Perl 5.7.3 and later to avoid these problems signals are
the full list of relevant environment variables and L<USING LOCALES>
for their effects in Perl. Effects in other programs are
easily deducible. For example, the variable LC_COLLATE may well affect
-your B<sort> program (or whatever the program that arranges `records'
+your B<sort> program (or whatever the program that arranges "records"
alphabetically in your system is called).
You can test out changing these variables temporarily, and if the
Do not assume anything about the ordering of the characters.
The lowercase letters may come before or after the uppercase letters;
-the lowercase and uppercase may be interlaced so that both `a' and `A'
-come before `b'; the accented and other international characters may
-be interlaced so that E<auml> comes before `b'.
+the lowercase and uppercase may be interlaced so that both "a" and "A"
+come before "b"; the accented and other international characters may
+be interlaced so that E<auml> comes before "b".
=head2 Internationalisation
=item [1]
-A GNU extension equivalent to C<[ \t]>, `all horizontal whitespace'.
+A GNU extension equivalent to C<[ \t]>, "all horizontal whitespace".
=item [2]
Not exactly equivalent to C<\s> since the C<[[:space:]]> includes
-also the (very rare) `vertical tabulator', "\ck", chr(11).
+also the (very rare) "vertical tabulator", "\ck", chr(11).
=item [3]
alpha IsAlpha
alnum IsAlnum
ascii IsASCII
- blank IsSpace
+ blank IsSpace
cntrl IsCntrl
digit IsDigit \d
graph IsGraph
If the C<utf8> pragma is not used but the C<locale> pragma is, the
classes correlate with the usual isalpha(3) interface (except for
-`word' and `blank').
+"word" and "blank").
The assumedly non-obviously named classes are:
accustomed to using nested subroutines in other programming languages with
their own private variables, you'll have to work at it a bit in Perl. The
intuitive coding of this type of thing incurs mysterious warnings about
-``will not stay shared''. For example, this won't work:
+"will not stay shared". For example, this won't work:
sub outer {
my $x = $_[0] + 35;
sub inner { return $x * 19 } # WRONG
return $x + inner();
- }
+ }
A work-around is the following:
my $x = $_[0] + 35;
local *inner = sub { return $x * 19 };
return $x + inner();
- }
+ }
Now inner() can only be called from within outer(), because of the
temporary assignments of the closure (anonymous subroutine). But when
=head2 Boss/Worker
-The boss/worker model usually has one `boss' thread and one or more
-`worker' threads. The boss thread gathers or generates tasks that need
+The boss/worker model usually has one "boss" thread and one or more
+"worker" threads. The boss thread gathers or generates tasks that need
to be done, then parcels those tasks out to the appropriate worker
thread.