Skip to content

Commit

Permalink
Update perlfaq to CPAN version 5.20191102
Browse files Browse the repository at this point in the history
  [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)
  • Loading branch information
karenetheridge committed Nov 2, 2019
1 parent 17446f3 commit a592016
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 75 deletions.
2 changes: 1 addition & 1 deletion Porting/Maintainers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ package Maintainers;
},

'perlfaq' => {
'DISTRIBUTION' => 'ETHER/perlfaq-5.20190126.tar.gz',
'DISTRIBUTION' => 'ETHER/perlfaq-5.20191102.tar.gz',
'FILES' => q[cpan/perlfaq],
'EXCLUDED' => [ qr/^inc/, qr/^xt/, qr{^t/00-} ],
},
Expand Down
10 changes: 10 additions & 0 deletions cpan/perlfaq/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/Changes
/LICENSE
/MANIFEST
/META.json
/META.yml
/README
/dist.ini
/inc/
/t/00-compile.t
/xt/
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ use strict;
use warnings;
package perlfaq;

our $VERSION = '5.20190126';
our $VERSION = '5.20191102';

1;
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq - Frequently asked questions about Perl

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq1.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq1 - General Questions About Perl

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq2.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq2 - Obtaining and Learning about Perl

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down
14 changes: 7 additions & 7 deletions cpan/perlfaq/lib/perlfaq3.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq3 - Programming Tools

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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/> .
Expand All @@ -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>.

Expand Down
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq4.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq4 - Data Manipulation

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq5.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq5 - Files and Formats

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq6.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq6 - Regular Expressions

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlfaq7.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq7 - General Perl Language Issues

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down
8 changes: 2 additions & 6 deletions cpan/perlfaq/lib/perlfaq8.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq8 - System Interaction

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
102 changes: 50 additions & 52 deletions cpan/perlfaq/lib/perlfaq9.pod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ perlfaq9 - Web, Email and Networking

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down Expand Up @@ -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?

Expand All @@ -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>
Expand Down Expand Up @@ -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 => '[email protected]',
To => '[email protected]',
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('[email protected]')
->to('[email protected]')
->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:
Expand All @@ -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?

Expand All @@ -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('[email protected]')
->subject('The file')
->attach_file('stuff.csv')
->send_or_die;

=head2 How do I read email?

Use the L<Email::Folder> module, like so:
Expand Down
2 changes: 1 addition & 1 deletion cpan/perlfaq/lib/perlglossary.pod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ perlglossary - Perl Glossary

=head1 VERSION

version 5.20190126
version 5.20191102

=head1 DESCRIPTION

Expand Down

0 comments on commit a592016

Please sign in to comment.