summaryrefslogtreecommitdiff
path: root/cpan/perlfaq
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2020-01-25 11:13:27 -0800
committerKaren Etheridge <ether@cpan.org>2020-01-25 11:16:05 -0800
commitfd9c22e56536c51f0c621c365b440c3ca01c1ce4 (patch)
tree3005a05f50936bd4b56978d3d22880282380cc0a /cpan/perlfaq
parentd8e1e69d20817fd4b9d94736c97ef585900451a4 (diff)
downloadperl-fd9c22e56536c51f0c621c365b440c3ca01c1ce4.tar.gz
Update perlfaq to CPAN version 5.20200125
[DELTA] 5.20200125 2020-01-25 19:11:04Z * remove references to smartmatch in perlfaq4; replace use of List::Util::first with any (PR#85, Dan Book) * add links to plackperl.org (#66)
Diffstat (limited to 'cpan/perlfaq')
-rw-r--r--cpan/perlfaq/lib/perlfaq.pm2
-rw-r--r--cpan/perlfaq/lib/perlfaq.pod2
-rw-r--r--cpan/perlfaq/lib/perlfaq1.pod2
-rw-r--r--cpan/perlfaq/lib/perlfaq2.pod2
-rw-r--r--cpan/perlfaq/lib/perlfaq3.pod4
-rw-r--r--cpan/perlfaq/lib/perlfaq4.pod39
-rw-r--r--cpan/perlfaq/lib/perlfaq5.pod2
-rw-r--r--cpan/perlfaq/lib/perlfaq6.pod2
-rw-r--r--cpan/perlfaq/lib/perlfaq7.pod2
-rw-r--r--cpan/perlfaq/lib/perlfaq8.pod2
-rw-r--r--cpan/perlfaq/lib/perlfaq9.pod4
-rw-r--r--cpan/perlfaq/lib/perlglossary.pod2
12 files changed, 19 insertions, 46 deletions
diff --git a/cpan/perlfaq/lib/perlfaq.pm b/cpan/perlfaq/lib/perlfaq.pm
index 607ab2ae87..5f515ca23c 100644
--- a/cpan/perlfaq/lib/perlfaq.pm
+++ b/cpan/perlfaq/lib/perlfaq.pm
@@ -2,6 +2,6 @@ use strict;
use warnings;
package perlfaq;
-our $VERSION = '5.20191102';
+our $VERSION = '5.20200125';
1;
diff --git a/cpan/perlfaq/lib/perlfaq.pod b/cpan/perlfaq/lib/perlfaq.pod
index e9289a3005..ee5c25f298 100644
--- a/cpan/perlfaq/lib/perlfaq.pod
+++ b/cpan/perlfaq/lib/perlfaq.pod
@@ -4,7 +4,7 @@ perlfaq - Frequently asked questions about Perl
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq1.pod b/cpan/perlfaq/lib/perlfaq1.pod
index 1630b4d6d5..3ee86e2336 100644
--- a/cpan/perlfaq/lib/perlfaq1.pod
+++ b/cpan/perlfaq/lib/perlfaq1.pod
@@ -4,7 +4,7 @@ perlfaq1 - General Questions About Perl
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq2.pod b/cpan/perlfaq/lib/perlfaq2.pod
index f90a07949d..372cc84b4d 100644
--- a/cpan/perlfaq/lib/perlfaq2.pod
+++ b/cpan/perlfaq/lib/perlfaq2.pod
@@ -4,7 +4,7 @@ perlfaq2 - Obtaining and Learning about Perl
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq3.pod b/cpan/perlfaq/lib/perlfaq3.pod
index d3448355fc..0051cc804c 100644
--- a/cpan/perlfaq/lib/perlfaq3.pod
+++ b/cpan/perlfaq/lib/perlfaq3.pod
@@ -4,7 +4,7 @@ perlfaq3 - Programming Tools
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
@@ -1066,7 +1066,7 @@ guides and references in L<perlfaq9> or in the CGI MetaFAQ:
L<http://www.perl.org/CGI_MetaFAQ.html>
-Looking in to L<Plack> and modern Perl web frameworks is highly recommended,
+Looking into L<https://plackperl.org> and modern Perl web frameworks is highly recommended,
though; web programming in Perl has evolved a long way from the old days of
simple CGI scripts.
diff --git a/cpan/perlfaq/lib/perlfaq4.pod b/cpan/perlfaq/lib/perlfaq4.pod
index 6c08edaa59..ba5c7e5c79 100644
--- a/cpan/perlfaq/lib/perlfaq4.pod
+++ b/cpan/perlfaq/lib/perlfaq4.pod
@@ -4,7 +4,7 @@ perlfaq4 - Data Manipulation
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
@@ -1422,21 +1422,7 @@ Hearing the word "in" is an I<in>dication that you probably should have
used a hash, not a list or array, to store your data. Hashes are
designed to answer this question quickly and efficiently. Arrays aren't.
-That being said, there are several ways to approach this. In Perl 5.10
-and later, you can use the smart match operator to check that an item is
-contained in an array or a hash:
-
- use 5.010;
-
- if( $item ~~ @array ) {
- say "The array contains $item"
- }
-
- if( $item ~~ %hash ) {
- say "The hash contains $item"
- }
-
-With earlier versions of Perl, you have to do a bit more work. If you
+That being said, there are several ways to approach this. If you
are going to make this query many times over arbitrary string values,
the fastest way is probably to invert the original array and maintain a
hash whose keys are the first array's values:
@@ -1472,16 +1458,16 @@ of the original list or array. They only pay off if you have to test
multiple values against the same array.
If you are testing only once, the standard module L<List::Util> exports
-the function C<first> for this purpose. It works by stopping once it
+the function C<any> for this purpose. It works by stopping once it
finds the element. It's written in C for speed, and its Perl equivalent
looks like this subroutine:
- sub first (&@) {
+ sub any (&@) {
my $code = shift;
foreach (@_) {
- return $_ if &{$code}();
+ return 1 if $code->();
}
- undef;
+ return 0;
}
If speed is of little concern, the common idiom uses grep in scalar context
@@ -1514,19 +1500,6 @@ in either A or in B but not in both. Think of it as an xor operation.
=head2 How do I test whether two arrays or hashes are equal?
-With Perl 5.10 and later, the smart match operator can give you the answer
-with the least amount of work:
-
- use 5.010;
-
- if( @array1 ~~ @array2 ) {
- say "The arrays are the same";
- }
-
- if( %hash1 ~~ %hash2 ) # doesn't check values! {
- say "The hash keys are the same";
- }
-
The following code works for single-level arrays. It uses a
stringwise comparison, and does not distinguish defined versus
undefined empty strings. Modify if you have other needs.
diff --git a/cpan/perlfaq/lib/perlfaq5.pod b/cpan/perlfaq/lib/perlfaq5.pod
index 1af7c69d26..e1829ef992 100644
--- a/cpan/perlfaq/lib/perlfaq5.pod
+++ b/cpan/perlfaq/lib/perlfaq5.pod
@@ -4,7 +4,7 @@ perlfaq5 - Files and Formats
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq6.pod b/cpan/perlfaq/lib/perlfaq6.pod
index e8d7f0f4f3..b1cd79f1a8 100644
--- a/cpan/perlfaq/lib/perlfaq6.pod
+++ b/cpan/perlfaq/lib/perlfaq6.pod
@@ -4,7 +4,7 @@ perlfaq6 - Regular Expressions
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq7.pod b/cpan/perlfaq/lib/perlfaq7.pod
index 4653fa8fcc..47801a3090 100644
--- a/cpan/perlfaq/lib/perlfaq7.pod
+++ b/cpan/perlfaq/lib/perlfaq7.pod
@@ -4,7 +4,7 @@ perlfaq7 - General Perl Language Issues
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq8.pod b/cpan/perlfaq/lib/perlfaq8.pod
index 65e58bf6d7..baf932f8b8 100644
--- a/cpan/perlfaq/lib/perlfaq8.pod
+++ b/cpan/perlfaq/lib/perlfaq8.pod
@@ -4,7 +4,7 @@ perlfaq8 - System Interaction
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq9.pod b/cpan/perlfaq/lib/perlfaq9.pod
index 7cbe462f7a..09e42358e8 100644
--- a/cpan/perlfaq/lib/perlfaq9.pod
+++ b/cpan/perlfaq/lib/perlfaq9.pod
@@ -4,7 +4,7 @@ perlfaq9 - Web, Email and Networking
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION
@@ -78,7 +78,7 @@ Plack is like Ruby's Rack or Python's Paste for WSGI.
You could build a web site using L<Plack> and your own code,
but for anything other than a very basic web site, using a web framework
-(that uses L<Plack>) is a better option.
+(that uses L<https://plackperl.org>) is a better option.
=head2 How do I remove HTML from a string?
diff --git a/cpan/perlfaq/lib/perlglossary.pod b/cpan/perlfaq/lib/perlglossary.pod
index 1fe9fca924..3bca2079b4 100644
--- a/cpan/perlfaq/lib/perlglossary.pod
+++ b/cpan/perlfaq/lib/perlglossary.pod
@@ -7,7 +7,7 @@ perlglossary - Perl Glossary
=head1 VERSION
-version 5.20191102
+version 5.20200125
=head1 DESCRIPTION