summaryrefslogtreecommitdiff
path: root/cpan/perlfaq
diff options
context:
space:
mode:
authorKaren Etheridge <ether@cpan.org>2019-11-01 22:39:50 -0700
committerKaren Etheridge <ether@cpan.org>2019-11-01 23:03:30 -0700
commita592016023e207677577097fb5a33602deb6379c (patch)
treea9e5584aa7f9107882cddaccbbbfb2df4bf0f75e /cpan/perlfaq
parent17446f3be176add274358834a965e251ec11ab28 (diff)
downloadperl-a592016023e207677577097fb5a33602deb6379c.tar.gz
Update perlfaq to CPAN version 5.20191102
[DELTA] 5.20191102 2019-11-02 05:34:43Z * fix bad pod markup in perlfaq8 (PR #78; thanks, JoaquĆ­n Ferrero!) * remove stale section about lib.pm (PR #82, Dan Book) * update perlfaq9 to reference Email::Stuffer (PR #79, Dan Book) * update perlfaq9 to reference URL::Search (PR #80, Dan Book) * update perlfaq9 to use HTTP::Tiny (PR #81, Dan Book) * fix some broken links (issue #71, dctabuyz)
Diffstat (limited to 'cpan/perlfaq')
-rw-r--r--cpan/perlfaq/.gitignore10
-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.pod14
-rw-r--r--cpan/perlfaq/lib/perlfaq4.pod2
-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.pod8
-rw-r--r--cpan/perlfaq/lib/perlfaq9.pod102
-rw-r--r--cpan/perlfaq/lib/perlglossary.pod2
13 files changed, 78 insertions, 74 deletions
diff --git a/cpan/perlfaq/.gitignore b/cpan/perlfaq/.gitignore
new file mode 100644
index 0000000000..e98894012a
--- /dev/null
+++ b/cpan/perlfaq/.gitignore
@@ -0,0 +1,10 @@
+/Changes
+/LICENSE
+/MANIFEST
+/META.json
+/META.yml
+/README
+/dist.ini
+/inc/
+/t/00-compile.t
+/xt/
diff --git a/cpan/perlfaq/lib/perlfaq.pm b/cpan/perlfaq/lib/perlfaq.pm
index b3645bc3cb..607ab2ae87 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.20190126';
+our $VERSION = '5.20191102';
1;
diff --git a/cpan/perlfaq/lib/perlfaq.pod b/cpan/perlfaq/lib/perlfaq.pod
index 3dd9f6c3c9..e9289a3005 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.20190126
+version 5.20191102
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq1.pod b/cpan/perlfaq/lib/perlfaq1.pod
index 4c023f8eb4..1630b4d6d5 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.20190126
+version 5.20191102
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq2.pod b/cpan/perlfaq/lib/perlfaq2.pod
index c039bdfd13..f90a07949d 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.20190126
+version 5.20191102
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq3.pod b/cpan/perlfaq/lib/perlfaq3.pod
index df99fd8d87..d3448355fc 100644
--- a/cpan/perlfaq/lib/perlfaq3.pod
+++ b/cpan/perlfaq/lib/perlfaq3.pod
@@ -4,7 +4,7 @@ perlfaq3 - Programming Tools
=head1 VERSION
-version 5.20190126
+version 5.20191102
=head1 DESCRIPTION
@@ -300,8 +300,8 @@ L<http://www.ddj.com/184404522> , and "Profiling in Perl"
L<http://www.ddj.com/184404580> .
Perl.com has two interesting articles on profiling: "Profiling Perl",
-by Simon Cozens, L<http://www.perl.com/lpt/a/850> and "Debugging and
-Profiling mod_perl Applications", by Frank Wiles,
+by Simon Cozens, L<https://www.perl.com/pub/2004/06/25/profiling.html/>
+and "Debugging and Profiling mod_perl Applications", by Frank Wiles,
L<http://www.perl.com/pub/a/2006/02/09/debug_mod_perl.html> .
Randal L. Schwartz writes about profiling in "Speeding up Your Perl
@@ -340,7 +340,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<http://www.cpan.org/authors/id/TOMC/scripts/toms.exrc.gz>
+L<http://www.cpan.org/authors/id/T/TO/TOMC/scripts/toms.exrc.gz>
=head2 Is there an IDE or Windows Perl Editor?
@@ -497,7 +497,7 @@ L<http://www.vim.org/>
=item Vile
-L<http://dickey.his.com/vile/vile.html>
+L<http://invisible-island.net/vile/vile.html>
=back
@@ -558,7 +558,7 @@ are text editors for OS X that have a Perl sensitivity mode
=head2 Where can I get Perl macros for vi?
For a complete version of Tom Christiansen's vi configuration file,
-see L<http://www.cpan.org/authors/Tom_Christiansen/scripts/toms.exrc.gz> ,
+see L<http://www.cpan.org/authors/id/T/TO/TOMC/scripts/toms.exrc.gz> ,
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<http://www.cpan.org/src/misc/> .
@@ -581,7 +581,7 @@ For CPerlMode, see L<http://www.emacswiki.org/cgi-bin/wiki/CPerlMode>
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<http://www.cpan.org/authors/Tom_Christiansen/scripts/rep.gz> ;
+directory L<http://www.cpan.org/authors/id/T/TO/TOMC/scripts/rep.gz> ;
this program repeats a command and updates the screen as needed, rendering
B<rep ps axu> similar to B<top>.
diff --git a/cpan/perlfaq/lib/perlfaq4.pod b/cpan/perlfaq/lib/perlfaq4.pod
index 55f9f6fd13..6c08edaa59 100644
--- a/cpan/perlfaq/lib/perlfaq4.pod
+++ b/cpan/perlfaq/lib/perlfaq4.pod
@@ -4,7 +4,7 @@ perlfaq4 - Data Manipulation
=head1 VERSION
-version 5.20190126
+version 5.20191102
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq5.pod b/cpan/perlfaq/lib/perlfaq5.pod
index aa7764b969..1af7c69d26 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.20190126
+version 5.20191102
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq6.pod b/cpan/perlfaq/lib/perlfaq6.pod
index eeaad01e2b..e8d7f0f4f3 100644
--- a/cpan/perlfaq/lib/perlfaq6.pod
+++ b/cpan/perlfaq/lib/perlfaq6.pod
@@ -4,7 +4,7 @@ perlfaq6 - Regular Expressions
=head1 VERSION
-version 5.20190126
+version 5.20191102
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq7.pod b/cpan/perlfaq/lib/perlfaq7.pod
index c2014646cc..4653fa8fcc 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.20190126
+version 5.20191102
=head1 DESCRIPTION
diff --git a/cpan/perlfaq/lib/perlfaq8.pod b/cpan/perlfaq/lib/perlfaq8.pod
index d9418ed503..65e58bf6d7 100644
--- a/cpan/perlfaq/lib/perlfaq8.pod
+++ b/cpan/perlfaq/lib/perlfaq8.pod
@@ -4,7 +4,7 @@ perlfaq8 - System Interaction
=head1 VERSION
-version 5.20190126
+version 5.20191102
=head1 DESCRIPTION
@@ -1323,7 +1323,7 @@ settings. See the L<ExtUtils::Makemaker> documentation for more details.
(contributed by brian d foy)
If you know the directory already, you can add it to C<@INC> as you would
-for any other directory. You might <use lib> if you know the directory
+for any other directory. You might C<use lib> if you know the directory
at compile time:
use lib $directory;
@@ -1400,10 +1400,6 @@ environment variables, run-time switches, and in-code statements:
=back
-The last is particularly useful because it knows about machine-dependent
-architectures. The C<lib.pm> pragmatic module was first
-included with the 5.002 release of Perl.
-
=head2 Where are modules installed?
Modules are installed on a case-by-case basis (as provided by the methods
diff --git a/cpan/perlfaq/lib/perlfaq9.pod b/cpan/perlfaq/lib/perlfaq9.pod
index 4a6799c589..7cbe462f7a 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.20190126
+version 5.20191102
=head1 DESCRIPTION
@@ -95,29 +95,30 @@ L<HTML::LinkExtor> or L<HTML::Parser>. You might even use
L<HTML::SimpleLinkExtor> as an example for something specifically
suited to your needs.
-You can use L<URI::Find> to extract URLs from an arbitrary text document.
+You can use L<URI::Find> or L<URL::Search> to extract URLs from an
+arbitrary text document.
=head2 How do I fetch an HTML file?
(contributed by brian d foy)
-Use the libwww-perl distribution. The L<LWP::Simple> module can fetch web
-resources and give their content back to you as a string:
+The core L<HTTP::Tiny> module can fetch web resources and give their
+content back to you as a string:
- use LWP::Simple qw(get);
+ use HTTP::Tiny;
- my $html = get( "http://www.example.com/index.html" );
+ my $ua = HTTP::Tiny->new;
+ my $html = $ua->get( "http://www.example.com/index.html" )->{content};
It can also store the resource directly in a file:
- use LWP::Simple qw(getstore);
+ $ua->mirror( "http://www.example.com/index.html", "foo.html" );
- getstore( "http://www.example.com/index.html", "foo.html" );
-
-If you need to do something more complicated, you can use
-L<LWP::UserAgent> module to create your own user-agent (e.g. browser)
-to get the job done. If you want to simulate an interactive web
-browser, you can use the L<WWW::Mechanize> module.
+If you need to do something more complicated, the L<HTTP::Tiny> object can
+be customized by setting attributes, or you can use L<LWP::UserAgent> from
+the libwww-perl distribution or L<Mojo::UserAgent> from the Mojolicious
+distribution to make common tasks easier. If you want to simulate an
+interactive web browser, you can use the L<WWW::Mechanize> module.
=head2 How do I automate an HTML form submission?
@@ -126,25 +127,26 @@ and forms or a web site, you can use L<WWW::Mechanize>. See its
documentation for all the details.
If you're submitting values using the GET method, create a URL and encode
-the form using the C<query_form> method:
+the form using the C<www_form_urlencode> method from L<HTTP::Tiny>:
+
+ use HTTP::Tiny;
- use LWP::Simple;
- use URI::URL;
+ my $ua = HTTP::Tiny->new;
- my $url = url('L<http://www.perl.com/cgi-bin/cpan_mod')>;
- $url->query_form(module => 'DB_File', readme => 1);
- $content = get($url);
+ my $query = $ua->www_form_urlencode([ q => 'DB_File', lucky => 1 ]);
+ my $url = "https://metacpan.org/search?$query";
+ my $content = $ua->get($url)->{content};
-If you're using the POST method, create your own user agent and encode
-the content appropriately.
+If you're using the POST method, the C<post_form> method will encode the
+content appropriately.
- use HTTP::Request::Common qw(POST);
- use LWP::UserAgent;
+ use HTTP::Tiny;
- my $ua = LWP::UserAgent->new();
- my $req = POST 'L<http://www.perl.com/cgi-bin/cpan_mod'>,
- [ module => 'DB_File', readme => 1 ];
- my $content = $ua->request($req)->as_string;
+ my $ua = HTTP::Tiny->new;
+
+ my $url = 'https://metacpan.org/search';
+ my $form = [ q => 'DB_File', lucky => 1 ];
+ my $content = $ua->post_form($url, $form)->{content};
=head2 How do I decode or create those %-encodings on the web?
X<URI> X<URI::Escape> X<RFC 2396>
@@ -287,26 +289,18 @@ your policy says it is. You really are best off asking the user.
=head2 How do I send email?
-Use the L<Email::MIME> and L<Email::Sender::Simple> modules, like so:
+Use the L<Email::Stuffer> module, like so:
# first, create your message
- my $message = Email::MIME->create(
- header_str => [
- From => 'you@example.com',
- To => 'friend@example.com',
- Subject => 'Happy birthday!',
- ],
- attributes => {
- encoding => 'quoted-printable',
- charset => 'utf-8',
- },
- body_str => "Happy birthday to you!\n",
- );
-
- use Email::Sender::Simple qw(sendmail);
- sendmail($message);
-
-By default, L<Email::Sender::Simple> will try `sendmail` first, if it exists
+ my $message = Email::Stuffer->from('you@example.com')
+ ->to('friend@example.com')
+ ->subject('Happy birthday!')
+ ->text_body("Happy birthday to you!\n");
+
+ $message->send_or_die;
+
+By default, L<Email::Sender::Simple> (the C<send> and C<send_or_die> methods
+use this under the hood) will try C<sendmail> first, if it exists
in your $PATH. This generally isn't the case. If there's a remote mail
server you use to send mail, consider investigating one of the Transport
classes. At time of writing, the available transports include:
@@ -326,14 +320,9 @@ uses TLS or SSL and can authenticate to the server via SASL.
=back
-Telling L<Email::Sender::Simple> to use your transport is straightforward.
+Telling L<Email::Stuffer> to use your transport is straightforward.
- sendmail(
- $message,
- {
- transport => $email_sender_transport_object,
- }
- );
+ $message->transport($email_sender_transport_object)->send_or_die;
=head2 How do I use MIME to make an attachment to a mail message?
@@ -342,6 +331,15 @@ objects themselves are parts and can be attached to other L<Email::MIME>
objects. Consult the L<Email::MIME> documentation for more information,
including all of the supported methods and examples of their use.
+L<Email::Stuffer> uses L<Email::MIME> under the hood to construct
+messages, and wraps the most common attachment tasks with the simple
+C<attach> and C<attach_file> methods.
+
+ Email::Stuffer->to('friend@example.com')
+ ->subject('The file')
+ ->attach_file('stuff.csv')
+ ->send_or_die;
+
=head2 How do I read email?
Use the L<Email::Folder> module, like so:
diff --git a/cpan/perlfaq/lib/perlglossary.pod b/cpan/perlfaq/lib/perlglossary.pod
index 3fef83de0d..1fe9fca924 100644
--- a/cpan/perlfaq/lib/perlglossary.pod
+++ b/cpan/perlfaq/lib/perlglossary.pod
@@ -7,7 +7,7 @@ perlglossary - Perl Glossary
=head1 VERSION
-version 5.20190126
+version 5.20191102
=head1 DESCRIPTION