diff --git a/bin/check_links b/bin/check_links
new file mode 100755
index 0000000..815dee9
--- /dev/null
+++ b/bin/check_links
@@ -0,0 +1,110 @@
+#!/usr/bin/perl
+use v5.36;
+use strict;
+use warnings;
+
+=head1 NAME
+
+bin/check_links - verify the links in the perlfaq
+
+=head1 SYNOPSIS
+
+ # check all the links in
+ perl bin/check_links
+
+ # check a single perlfaq page, just specify the number
+ perl bin/check_links 3
+
+ # check a range with the min and max
+ perl bin/check_links 3 6
+
+ # see all the errors at the end
+ perl bin/check_links | sort
+
+=head1 DESCRIPTION
+
+This program extracts the links from all the perlfaq pages then tries
+to fetch them. It reports the HTTP status, the perlfaq page, and the
+link. In the case of a redirect response, it also reports the Location
+value.
+
+Note that redirections sometimes leads to more redirections, which this
+does not handle. Sometimes those chains lead to dead links, or even
+cycles.
+
+If the program cannot connect to a server, it reports a 500
+status. This does not mean the link is bad since this could be a local
+network hiccup.
+
+If there are any bad links (permanent redirects, or any 4xx or 5xx
+statuses), this program exits with a non-zero value. If no links are
+bad, it exits with 0.
+
+=head1 AUTHOR
+
+brian d foy, bdfoy@cpan.org
+
+=head1 LICENSE
+
+You can use and distribute this under the same terms as perl. A LICENSE
+file is included with the perlfaq repository.
+
+=cut
+
+use File::Spec::Functions;
+use Mojo::Promise;
+use Mojo::UserAgent;
+use Mojo::Util qw(dumper);
+
+@ARGV = ( 1, 9 ) unless @ARGV;
+my( $min, $max ) = @ARGV;
+$max //= $min;
+
+my $ua = Mojo::UserAgent->new;
+$ua->inactivity_timeout(10);
+
+my $Checked = {};
+
+sub print_status ( $code, $section, $link, $redirect = undef ) {
+ printf "%3d %8s %s%s\n", $code, $section, $link,
+ defined $redirect ? ' -> ' . $redirect : '';
+ ;
+ }
+
+my @promises =
+ map {
+ my $t = $_;
+
+ my $success = sub ($tx) {
+ $Checked->{$t->{link}}{code} = $tx->res->code;
+ $Checked->{$t->{link}}{count}++;
+ $Checked->{$t->{link}}{location} = $tx->res->headers->location;
+ print_status( $tx->res->code, $t->{section}, $t->{link}, $tx->res->headers->location )
+ };
+
+ my $error = sub ($err) {
+ $Checked->{$t->{link}}{code} = 500;
+ $Checked->{$t->{link}}{count}++;
+ print_status( 500, $t->{section}, $t->{link}, undef )
+ };
+
+ my $promise = $ua->get_p( $t->{link} )->then(
+ $success,
+ $error,
+ );
+ }
+ map {
+ my $section = "perlfaq$_";
+ my $path = catfile( 'lib', "$section.pod" );
+ my $contents = Mojo::File->new( $path )->slurp;
+ my @links = $contents =~ m|L<(?:[^>]+?\|)?(https?://.+?)>|ig;
+ map { { section => $section, path => $path, link => $_ } } @links;
+ }
+ $min .. $max;
+
+my $all = Mojo::Promise->all_settled( @promises );
+$all->wait;
+
+my $Errors = () = grep { $_->{code} =~ m/30[18]|[45]\d\d/ } values $Checked->%*;
+
+exit( $Errors ? 1 : 0 );
diff --git a/dist.ini b/dist.ini
index dd2ba4b..43eb52f 100644
--- a/dist.ini
+++ b/dist.ini
@@ -28,6 +28,7 @@ format = 5.{{ cldr('yyyyMMdd') . ($ENV{DEV} ? sprintf('_%03u', $ENV{DEV}) : '')
[Git::GatherDir]
exclude_filename = LICENSE
exclude_filename = README.pod ; cannot be included in the tarball or it will be installed!
+exclude_filename = bin/check_links
[RunExtraTests]
:version = 0.019
diff --git a/lib/perlfaq1.pod b/lib/perlfaq1.pod
index e1a91ef..3ef4e4b 100644
--- a/lib/perlfaq1.pod
+++ b/lib/perlfaq1.pod
@@ -37,7 +37,7 @@ The core development team (known as the Perl Porters)
are a group of highly altruistic individuals committed to
producing better software for free than you could hope to purchase for
money. You may snoop on pending developments via the
-L
+L
or you can subscribe to the mailing list by sending
perl5-porters-subscribe@perl.org a subscription request
(an empty message with no subject is fine).
@@ -114,7 +114,7 @@ minor release (i.e. perl5.25.x, where 25 is the minor release).
=item *
-You can consult L to determine the
+You can consult L to determine the
current stable release of Perl.
=back
@@ -177,7 +177,7 @@ backward compatibility.
Recently, the plan has been to release a new version of Perl roughly every
April, but getting the release right is more important than sticking rigidly to
a calendar date, so the release date is somewhat flexible. The historical
-release dates can be viewed at L.
+release dates can be viewed at L.
Even numbered minor versions (5.14, 5.16, 5.18) are production versions, and
odd numbered minor versions (5.15, 5.17, 5.19) are development versions. Unless
@@ -185,13 +185,13 @@ you want to try out an experimental feature, you probably never want to install
a development version of Perl.
The Perl development team are called Perl 5 Porters, and their
-organization is described at L.
+organization is described at L.
The organizational rules really just boil down to one: Larry is always
right, even when he was wrong.
=head2 Is Perl difficult to learn?
-No, Perl is easy to start L --and easy to keep learning. It looks
+No, Perl is easy to start L --and easy to keep learning. It looks
like most programming languages you're likely to have experience
with, so if you've ever written a C program, an awk script, a shell
script, or even a BASIC program, you're already partway there.
@@ -213,7 +213,7 @@ of programming experience, an understanding of regular expressions, and
the ability to understand other people's code. If there's something you
need to do, then it's probably already been done, and a working example is
usually available for free. Don't forget Perl modules, either.
-They're discussed in Part 3 of this FAQ, along with L, which is
+They're discussed in Part 3 of this FAQ, along with L, which is
discussed in Part 2.
=head2 How does Perl compare with other languages like Java, Python, REXX, Scheme, or Tcl?
@@ -224,12 +224,12 @@ be used well or badly. Perl has many strengths, and a few weaknesses,
precisely which areas are good and bad is often a personal choice.
When choosing a language you should also be influenced by the
-L, L
-and L which surrounds it.
+L, L
+and L which surrounds it.
For comparisons to a specific language it is often best to create
a small project in both languages and compare the results, make sure
-to use all the L of each language,
+to use all the L of each language,
as a language is far more than just it's syntax.
=head2 Can I do [task] in Perl?
@@ -292,7 +292,7 @@ programs to produce the same output, spinning things quickly out of
control while still providing hours of amusement for their creators and
readers.
-CPAN has several JAPH programs at L.
+CPAN has several JAPH programs at L.
=head2 How can I convince others to use Perl?
@@ -312,8 +312,8 @@ choice and how Perl might satisfy that requirement.
You don't have to worry about finding or paying for Perl; it's freely
available and several popular operating systems come with Perl. Community
-support in places such as Perlmonks ( L )
-and the various Perl mailing lists ( L ) means that
+support in places such as Perlmonks ( L )
+and the various Perl mailing lists ( L ) means that
you can usually get quick answers to your problems.
Finally, keep in mind that Perl might not be the right tool for every
@@ -326,9 +326,9 @@ You might find these links useful:
=over 4
-=item * L
+=item * L
-=item * L
+=item * L
=back
diff --git a/lib/perlfaq2.pod b/lib/perlfaq2.pod
index b432853..7e68086 100644
--- a/lib/perlfaq2.pod
+++ b/lib/perlfaq2.pod
@@ -16,7 +16,7 @@ related matters.
The standard release of Perl (the one maintained by the Perl
development team) is distributed only in source code form. You
-can find the latest releases at L.
+can find the latest releases at L.
Perl builds and runs on a bewildering number of platforms. Virtually
all known and current Unix derivatives are supported (perl's native
@@ -24,7 +24,7 @@ platform), as are other systems like VMS, DOS, OS/2, Windows,
QNX, BeOS, OS X, MPE/iX and the Amiga.
Binary distributions for some proprietary platforms can be found
-L directory. Because these are not part of
+L directory. Because these are not part of
the standard distribution, they may and in fact do differ from the
base perl port in a variety of ways. You'll have to check their
respective release notes to see just what the differences are. These
@@ -35,13 +35,13 @@ source release of perl).
=head2 How can I get a binary version of Perl?
-See L
+See L
=head2 I don't have a C compiler. How can I build my own Perl interpreter?
For Windows, use a binary version of Perl,
-L and
-L come with a
+L and
+L come with a
bundled C compiler.
Otherwise if you really do want to build Perl, you need to get a
@@ -85,12 +85,12 @@ contains tens of thousands of modules and extensions, source code
and documentation, designed for I from commercial
database interfaces to keyboard/screen control and running large web sites.
-You can search CPAN on L.
+You can search CPAN on L.
-The master web site for CPAN is L,
-L lists all mirrors.
+The master web site for CPAN is L,
+L lists all mirrors.
-See the CPAN FAQ at L for answers
+See the CPAN FAQ at L for answers
to the most frequently asked questions about CPAN.
The L module has a list of recommended modules which
@@ -100,18 +100,18 @@ you should review as a good starting point.
=over 4
-=item * L
+=item * L
-=item * L
+=item * L
-=item * L
+=item * L
=back
The complete Perl documentation is available with the Perl distribution.
If you have Perl installed locally, you probably have the documentation
installed as well: type C in a terminal or
-L.
+L.
(Some operating system distributions may ship the documentation in a different
package; for instance, on Debian, you need to install the C package.)
@@ -121,13 +121,13 @@ L for more details.
=head2 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org?
-L used to be part of the O'Reilly
+L used to be part of the O'Reilly
Network, a subsidiary of O'Reilly Media. Although it retains most of
the original content from its O'Reilly Network, it is now hosted by
-L.
+L.
The Perl Foundation is an advocacy organization for the Perl language
-which maintains the web site L as a general
+which maintains the web site L as a general
advocacy site for the Perl language. It uses the domain to provide
general support services to the Perl community, including the hosting
of mailing lists, web sites, and other services. There are also many
@@ -136,39 +136,39 @@ such as:
=over 4
-=item * L
+=item * L
-=item * L
+=item * L
-=item * L
+=item * L
-=item * L
+=item * L
=back
-L uses the pm.org domain for services
+L uses the pm.org domain for services
related to local Perl user groups, including the hosting of mailing lists
-and web sites. See the L for more
+and web sites. See the L for more
information about joining, starting, or requesting services for a
Perl user group.
-CPAN, or the Comprehensive Perl Archive Network L,
+CPAN, or the Comprehensive Perl Archive Network L,
is a replicated, worldwide repository of Perl software.
See L.
=head2 Where can I post questions?
-There are many Perl L for various
-topics, specifically the L
+There are many Perl L for various
+topics, specifically the L
may be of use.
Other places to ask questions are on the
-L or
-L.
+L or
+L.
=head2 Perl Books
-There are many good L.
+There are many good L.
=head2 Which magazines have Perl content?
@@ -178,25 +178,26 @@ will find Perl content in more general interest programming titles.
In the distant past, there have been a few Perl magazines. The first was I, published by Jon Orwant. After that, there was I,
published by brian d foy, and I<$foo Magazin>, published by Renée Bäcker
-(L).
+(L).
The closest you might find today is Perl Weekly, (L),
an online newsletter with a magazine-like format.
=head2 Which Perl blogs should I read?
-L covers some of the major events in the Perl
-world, L is a weekly e-mail
+L covers some of the major events in the Perl
+world, L is a weekly e-mail
(and RSS feed) of hand-picked Perl articles.
-L hosts many Perl blogs, there are also
-several blog aggregators: L and
-L are two of them.
+L hosts many Perl blogs, and L
+serves as a blog aggregator
+
+You may also like L.
=head2 What mailing lists are there for Perl?
A comprehensive list of Perl-related mailing lists can be found at
-L
+L
=head2 Where can I buy a commercial version of Perl?
@@ -206,7 +207,7 @@ in releases and comes in well-defined packages. There is a very large
and supportive user community and an extensive literature.
If you still need commercial support
-L offers
+L offers
this.
=head2 Where do I send bug reports?
@@ -226,7 +227,7 @@ install and use the L module. It has the information
about the modules (with their versions) included with each release
of Perl.
-Every CPAN module has a bug tracker set up in RT, L.
+Every CPAN module has a bug tracker set up in RT, L.
You can submit bugs to RT either through its web interface or by
email. To email a bug report, send it to
bug-Edistribution-nameE@rt.cpan.org . For example, if you
diff --git a/lib/perlfaq3.pod b/lib/perlfaq3.pod
index 9fdee89..0ac58f5 100644
--- a/lib/perlfaq3.pod
+++ b/lib/perlfaq3.pod
@@ -133,7 +133,7 @@ Have you read the appropriate manpages? Here's a brief index:
=item Various
-L
+L
(not a man-page but still useful, a collection of various essays on
Perl techniques)
@@ -292,13 +292,13 @@ or I, chapter 5.
L documents creating a custom debugger if you need to
create a special sort of profiler. brian d foy describes the process
in I, "Creating a Perl Debugger",
-L , and "Profiling in Perl"
-L .
+L , and "Profiling in Perl"
+L .
Perl.com has two interesting articles on profiling: "Profiling Perl",
by Simon Cozens, L
and "Debugging and Profiling mod_perl Applications", by Frank Wiles,
-L .
+L .
Randal L. Schwartz writes about profiling in "Speeding up Your Perl
Programs" for I,
@@ -336,7 +336,7 @@ Put that in your F<.exrc> file (replacing the caret characters
with control characters) and away you go. In insert mode, ^T is
for indenting, ^D is for undenting, and ^O is for blockdenting--as
it were. A more complete example, with comments, can be found at
-L
+L
=head2 Is there an IDE or Windows Perl Editor?
@@ -353,14 +353,14 @@ order of preference):
=item Eclipse
-L
+L
The Eclipse Perl Integration Project integrates Perl
editing/debugging with Eclipse.
=item Enginsite
-L
+L
Perl Editor by EngInSite is a complete integrated development
environment (IDE) for creating, testing, and debugging Perl scripts;
@@ -368,13 +368,13 @@ the tool runs on Windows 9x/NT/2000/XP or later.
=item IntelliJ IDEA
-L
+L
Camelcade plugin provides Perl5 support in IntelliJ IDEA and other JetBrains IDEs.
=item Kephra
-L
+L
GUI editor written in Perl using wxWidgets and Scintilla with lots of smaller features.
Aims for a UI based on Perl principles like TIMTOWTDI and "easy things should be easy,
@@ -382,7 +382,7 @@ hard things should be possible".
=item Komodo
-L
+L
ActiveState's cross-platform (as of October 2004, that's Windows, Linux,
and Solaris), multi-language IDE has Perl support, including a regular expression
@@ -390,53 +390,33 @@ debugger and remote debugging.
=item Notepad++
-L
+L
=item Open Perl IDE
-L
+L
Open Perl IDE is an integrated development environment for writing
and debugging Perl scripts with ActiveState's ActivePerl distribution
under Windows 95/98/NT/2000.
-=item OptiPerl
-
-L
-
-OptiPerl is a Windows IDE with simulated CGI environment, including
-debugger and syntax-highlighting editor.
-
=item Padre
-L
+L
Padre is cross-platform IDE for Perl written in Perl using wxWidgets to provide
a native look and feel. It's open source under the Artistic License. It
is one of the newer Perl IDEs.
-=item PerlBuilder
-
-L
-
-PerlBuilder is an integrated development environment for Windows that
-supports Perl development.
-
=item visiPerl+
-L
+L
From Help Consulting, for Windows.
-=item Visual Perl
-
-L
-
-Visual Perl is a Visual Studio.NET plug-in from ActiveState.
-
=item Zeus
-L
+L
Zeus for Windows is another Win32 multi-language editor/IDE
that comes with support for Perl.
@@ -454,32 +434,28 @@ Microsoft Word or WordPerfect, typically do not work since they insert
all sorts of behind-the-scenes information, although some allow you to
save files as "Text Only". You can also download text editors designed
specifically for programming, such as Textpad (
-L ) and UltraEdit ( L ),
+L ) and UltraEdit ( L ),
among others.
If you are using MacOS, the same concerns apply. MacPerl (for Classic
environments) comes with a simple editor. Popular external editors are
-BBEdit ( L ) or Alpha (
-L ). MacOS X users can use
+BBEdit ( L ) or Alpha (
+L ). MacOS X users can use
Unix editors as well.
=over 4
=item GNU Emacs
-L
-
-=item MicroEMACS
-
-L
+L
=item XEmacs
-L
+L
=item Jed
-L
+L
=back
@@ -489,11 +465,11 @@ or a vi clone such as
=item Vim
-L
+L
=item Vile
-L
+L
=back
@@ -501,25 +477,21 @@ The following are Win32 multilanguage editor/IDEs that support Perl:
=over 4
-=item MultiEdit
-
-L
-
=item SlickEdit
-L
+L
=item ConTEXT
-L
+L
=back
There is also a toyedit Text widget based editor written in Perl
that is distributed with the Tk module on CPAN. The ptkdb
-( L ) is a Perl/Tk-based debugger that
+( L ) is a Perl/Tk-based debugger that
acts as a development environment of sorts. Perl Composer
-( L ) is an IDE for Perl/Tk
+( L ) is an IDE for Perl/Tk
GUI creation.
In addition to an editor/IDE you might be interested in a more
@@ -529,11 +501,11 @@ powerful shell environment for Win32. Your options include
=item bash
-from the Cygwin package ( L )
+from the Cygwin package ( L )
=item zsh
-L
+L
=back
@@ -547,17 +519,17 @@ of standard Unix toolkit utilities.
=item BBEdit and TextWrangler
are text editors for OS X that have a Perl sensitivity mode
-( L ).
+( L ).
=back
=head2 Where can I get Perl macros for vi?
For a complete version of Tom Christiansen's vi configuration file,
-see L ,
+see L ,
the standard benchmark file for vi emulators. The file runs best with nvi,
the current version of vi out of Berkeley, which incidentally can be built
-with an embedded Perl interpreter--see L .
+with an embedded Perl interpreter--see L .
=head2 Where can I get perl-mode or cperl-mode for emacs?
X
@@ -571,13 +543,13 @@ Note that the perl-mode of emacs will have fits with C<"main'foo">
are probably using C<"main::foo"> in new Perl code anyway, so this
shouldn't be an issue.
-For CPerlMode, see L
+For CPerlMode, see L
=head2 How can I use curses with Perl?
The Curses module from CPAN provides a dynamically loadable object
module interface to a curses library. A small demo can be found at the
-directory L ;
+directory L ;
this program repeats a command and updates the screen as needed, rendering
B similar to B.
@@ -602,7 +574,7 @@ simple gui. It hasn't been updated in a while.
=item Wx
This is a Perl binding for the cross-platform wxWidgets toolkit
-( L ). It works under Unix, Win32 and Mac OS X,
+( L ). It works under Unix, Win32 and Mac OS X,
using native widgets (Gtk under Unix). The interface follows the C++
interface closely, but the documentation is a little sparse for someone
who doesn't know the library, mostly just referring you to the C++
@@ -610,7 +582,7 @@ documentation.
=item Gtk and Gtk2
-These are Perl bindings for the Gtk toolkit ( L ). The
+These are Perl bindings for the Gtk toolkit ( L ). The
interface changed significantly between versions 1 and 2 so they have
separate Perl modules. It runs under Unix, Win32 and Mac OS X (currently
it requires an X server on Mac OS, but a 'native' port is underway), and
@@ -629,7 +601,7 @@ require familiarity with the C Win32 APIs, or reference to MSDN.
=item CamelBones
-CamelBones ( L ) is a Perl interface to
+CamelBones ( L ) is a Perl interface to
Mac OS X's Cocoa GUI toolkit, and as such can be used to produce native
GUIs on Mac OS X. It's not on CPAN, as it requires frameworks that
CPAN.pm doesn't know how to install, but installation is via the
@@ -852,7 +824,7 @@ you> because the process start-up overhead is where the bottleneck is.
There are three popular ways to avoid this overhead. One solution
involves running the Apache HTTP server (available from
-L ) with either of the mod_perl or mod_fastcgi
+L ) with either of the mod_perl or mod_fastcgi
plugin modules.
With mod_perl and the Apache::Registry module (distributed with
@@ -861,10 +833,10 @@ pre-compiles your script and then executes it within the same address
space without forking. The Apache extension also gives Perl access to
the internal server API, so modules written in Perl can do just about
anything a module written in C can. For more on mod_perl, see
-L
+L
With the FCGI module (from CPAN) and the mod_fastcgi
-module (available from L ) each of your Perl
+module (available from L ) each of your Perl
programs becomes a permanent CGI daemon process.
Finally, L is a Perl module and toolkit that contains PSGI middleware,
@@ -878,7 +850,7 @@ These solutions can have far-reaching effects on your system and on the way you
write your CGI programs, so investigate them with care.
See also
-L .
+L .
=head2 How can I hide the source for my Perl program?
@@ -942,11 +914,11 @@ available and on CPAN ( L ).
There are also some commercial products that may work for you, although
you have to buy a license for them.
-The Perl Dev Kit ( L )
+The Perl Dev Kit ( L )
from ActiveState can "Turn your Perl programs into ready-to-run
executables for HP-UX, Linux, Solaris and Windows."
-Perl2Exe ( L ) is a command line
+Perl2Exe ( L ) is a command line
program for converting perl scripts to executable files. It targets both
Windows and Unix platforms.
@@ -973,7 +945,7 @@ run the program C merely by typing C.
Under "Classic" MacOS, a perl program will have the appropriate Creator and
Type, so that double-clicking them will invoke the MacPerl application.
Under Mac OS X, clickable apps can be made from any C<#!> script using Wil
-Sanchez' DropScript utility: L .
+Sanchez' DropScript utility: L .
I: Whatever you do, PLEASE don't get frustrated, and just
throw the perl interpreter into your cgi-bin directory, in order to
@@ -1058,9 +1030,7 @@ 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
-guides and references in L or in the CGI MetaFAQ:
-
- L
+guides and references in L.
Looking into L and modern Perl web frameworks is highly recommended,
though; web programming in Perl has evolved a long way from the old days of
diff --git a/lib/perlfaq4.pod b/lib/perlfaq4.pod
index 2ae22ab..98dba6c 100644
--- a/lib/perlfaq4.pod
+++ b/lib/perlfaq4.pod
@@ -13,7 +13,7 @@ numbers, dates, strings, arrays, hashes, and miscellaneous data issues.
For the long explanation, see David Goldberg's "What Every Computer
Scientist Should Know About Floating-Point Arithmetic"
-(L).
+(L).
Internally, your computer represents floating-point numbers in binary.
Digital (as in powers of two) computers cannot store all numbers
@@ -378,7 +378,7 @@ will not create an intermediate list of 500,000 integers.
=head2 How can I output Roman numerals?
-Get the L module.
+Get the L module.
=head2 Why aren't my random numbers random?
@@ -394,7 +394,7 @@ rather than more.
Computers are good at being predictable and bad at being random
(despite appearances caused by bugs in your programs :-). The
F article in the "Far More Than You Ever Wanted To Know"
-collection in L, courtesy
+collection in L, courtesy
of 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."
@@ -402,14 +402,14 @@ course, living in a state of sin."
Perl relies on the underlying system for the implementation of
C and C; on some systems, the generated numbers are
not random enough (especially on Windows : see
-L).
+L).
Several CPAN modules in the C