This will list all FAQs from perlfaq[1-9] without their answers. Just a modification of subroutines from Pod::Perldoc.

Sample output:

$ perldocfaqs What is Perl? Who supports Perl? Who develops it? Why is it free? ..snip... What machines support perl? Where do I get it? ...snip... How do I fetch/put an FTP file? How can I do RPC in Perl?
Lists all FAQs line by line

$ perldocfaqs -n [perlfaq1 - 01] What is Perl? [perlfaq1 - 02] Who supports Perl? Who develops it? Why is it free? ...snip... [perlfaq2 - 01] What machines support perl? Where do I get it? ...snip... [perlfaq9 - 25] How do I fetch/put an FTP file? [perlfaq9 - 26] How can I do RPC in Perl?
Called with '-n' lists all FAQs with leading file info and faq number
#!/usr/bin/perl use strict; use warnings; use File::Basename 'fileparse'; use Pod::Perldoc; my $show_faqnums = (shift||0) eq '-n' ? 1 : 0; @ARGV = qw(-oText -q.); no warnings 'redefine'; sub Pod::Perldoc::search_perlfaqs { my ($self, $found_things, $pod) = @_; local $_; for my $file (@$found_things) { my $perlfaq = fileparse($file, qr/\.pod/); open(INFAQ, '<', $file) or die "$file: $!\n"; my $faqnum = sprintf '%02d', 1; while (<INFAQ>) { if (/^=head2\s/) { $show_faqnums and substr($_, 7, 0, "[$perlfaq - $faqnum] "); push @$pod, "$_\n"; $faqnum++; } } close(INFAQ); } return; } sub Pod::Perldoc::page { my ($self, $output) = @_; open(TMP, '<', $output) or die "$output: $!\n"; local $_; while (<TMP>) { s/^\s+//; print or die "$!\n"; } close TMP or die "$output: $!\n"; $self->unlink_if_temp_file($output); return; } Pod::Perldoc->run();

In reply to List all perldoc FAQs by Dietz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.