1N/A=head1 NAME
1N/A
1N/Aperlutil - utilities packaged with the Perl distribution
1N/A
1N/A=head1 DESCRIPTION
1N/A
1N/AAlong with the Perl interpreter itself, the Perl distribution installs a
1N/Arange of utilities on your system. There are also several utilities
1N/Awhich are used by the Perl distribution itself as part of the install
1N/Aprocess. This document exists to list all of these utilities, explain
1N/Awhat they are for and provide pointers to each module's documentation,
1N/Aif appropriate.
1N/A
1N/A=head2 DOCUMENTATION
1N/A
1N/A=over 3
1N/A
1N/A=item L<perldoc|perldoc>
1N/A
1N/AThe main interface to Perl's documentation is C<perldoc>, although
1N/Aif you're reading this, it's more than likely that you've already found
1N/Ait. F<perldoc> will extract and format the documentation from any file
1N/Ain the current directory, any Perl module installed on the system, or
1N/Aany of the standard documentation pages, such as this one. Use
1N/AC<perldoc E<lt>nameE<gt>> to get information on any of the utilities
1N/Adescribed in this document.
1N/A
1N/A=item L<pod2man|pod2man> and L<pod2text|pod2text>
1N/A
1N/AIf it's run from a terminal, F<perldoc> will usually call F<pod2man> to
1N/Atranslate POD (Plain Old Documentation - see L<perlpod> for an
1N/Aexplanation) into a manpage, and then run F<man> to display it; if
1N/AF<man> isn't available, F<pod2text> will be used instead and the output
1N/Apiped through your favourite pager.
1N/A
1N/A=item L<pod2html|pod2html> and L<pod2latex|pod2latex>
1N/A
1N/AAs well as these two, there are two other converters: F<pod2html> will
1N/Aproduce HTML pages from POD, and F<pod2latex>, which produces LaTeX
1N/Afiles.
1N/A
1N/A=item L<pod2usage|pod2usage>
1N/A
1N/AIf you just want to know how to use the utilities described here,
1N/AF<pod2usage> will just extract the "USAGE" section; some of
1N/Athe utilities will automatically call F<pod2usage> on themselves when
1N/Ayou call them with C<-help>.
1N/A
1N/A=item L<podselect|podselect>
1N/A
1N/AF<pod2usage> is a special case of F<podselect>, a utility to extract
1N/Anamed sections from documents written in POD. For instance, while
1N/Autilities have "USAGE" sections, Perl modules usually have "SYNOPSIS"
1N/Asections: C<podselect -s "SYNOPSIS" ...> will extract this section for
1N/Aa given file.
1N/A
1N/A=item L<podchecker|podchecker>
1N/A
1N/AIf you're writing your own documentation in POD, the F<podchecker>
1N/Autility will look for errors in your markup.
1N/A
1N/A=item L<splain|splain>
1N/A
1N/AF<splain> is an interface to L<perldiag> - paste in your error message
1N/Ato it, and it'll explain it for you.
1N/A
1N/A=item L<roffitall|roffitall>
1N/A
1N/AThe C<roffitall> utility is not installed on your system but lives in
1N/Athe F<pod/> directory of your Perl source kit; it converts all the
1N/Adocumentation from the distribution to F<*roff> format, and produces a
1N/Atypeset PostScript or text file of the whole lot.
1N/A
1N/A=back
1N/A
1N/A=head2 CONVERTORS
1N/A
1N/ATo help you convert legacy programs to Perl, we've included three
1N/Aconversion filters:
1N/A
1N/A=over 3
1N/A
1N/A=item L<a2p|a2p>
1N/A
1N/AF<a2p> converts F<awk> scripts to Perl programs; for example, C<a2p -F:>
1N/Aon the simple F<awk> script C<{print $2}> will produce a Perl program
1N/Abased around this code:
1N/A
1N/A while (<>) {
1N/A ($Fld1,$Fld2) = split(/[:\n]/, $_, 9999);
1N/A print $Fld2;
1N/A }
1N/A
1N/A=item L<s2p|s2p>
1N/A
1N/ASimilarly, F<s2p> converts F<sed> scripts to Perl programs. F<s2p> run
1N/Aon C<s/foo/bar> will produce a Perl program based around this:
1N/A
1N/A while (<>) {
1N/A chomp;
1N/A s/foo/bar/g;
1N/A print if $printit;
1N/A }
1N/A
1N/A=item L<find2perl|find2perl>
1N/A
1N/AFinally, F<find2perl> translates C<find> commands to Perl equivalents which
1N/Ause the L<File::Find|File::Find> module. As an example,
1N/AC<find2perl . -user root -perm 4000 -print> produces the following callback
1N/Asubroutine for C<File::Find>:
1N/A
1N/A sub wanted {
1N/A my ($dev,$ino,$mode,$nlink,$uid,$gid);
1N/A (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
1N/A $uid == $uid{'root'}) &&
1N/A (($mode & 0777) == 04000);
1N/A print("$name\n");
1N/A }
1N/A
1N/A=back
1N/A
1N/AAs well as these filters for converting other languages, the
1N/AL<pl2pm|pl2pm> utility will help you convert old-style Perl 4 libraries to
1N/Anew-style Perl5 modules.
1N/A
1N/A=head2 Administration
1N/A
1N/A=over 3
1N/A
1N/A=item L<libnetcfg|libnetcfg>
1N/A
1N/ATo display and change the libnet configuration run the libnetcfg command.
1N/A
1N/A=back
1N/A
1N/A=head2 Development
1N/A
1N/AThere are a set of utilities which help you in developing Perl programs,
1N/Aand in particular, extending Perl with C.
1N/A
1N/A=over 3
1N/A
1N/A=item L<perlbug|perlbug>
1N/A
1N/AF<perlbug> is the recommended way to report bugs in the perl interpreter
1N/Aitself or any of the standard library modules back to the developers;
1N/Aplease read through the documentation for F<perlbug> thoroughly before
1N/Ausing it to submit a bug report.
1N/A
1N/A=item L<h2ph|h2ph>
1N/A
1N/ABack before Perl had the XS system for connecting with C libraries,
1N/Aprogrammers used to get library constants by reading through the C
1N/Aheader files. You may still see C<require 'syscall.ph'> or similar
1N/Aaround - the F<.ph> file should be created by running F<h2ph> on the
1N/Acorresponding F<.h> file. See the F<h2ph> documentation for more on how
1N/Ato convert a whole bunch of header files at once.
1N/A
1N/A=item L<c2ph|c2ph> and L<pstruct|pstruct>
1N/A
1N/AF<c2ph> and F<pstruct>, which are actually the same program but behave
1N/Adifferently depending on how they are called, provide another way of
1N/Agetting at C with Perl - they'll convert C structures and union declarations
1N/Ato Perl code. This is deprecated in favour of F<h2xs> these days.
1N/A
1N/A=item L<h2xs|h2xs>
1N/A
1N/AF<h2xs> converts C header files into XS modules, and will try and write
1N/Aas much glue between C libraries and Perl modules as it can. It's also
1N/Avery useful for creating skeletons of pure Perl modules.
1N/A
1N/A=item L<dprofpp|dprofpp>
1N/A
1N/APerl comes with a profiler, the F<Devel::DProf> module. The
1N/AF<dprofpp> utility analyzes the output of this profiler and tells you
1N/Awhich subroutines are taking up the most run time. See L<Devel::DProf>
1N/Afor more information.
1N/A
1N/A=item L<perlcc|perlcc>
1N/A
1N/AF<perlcc> is the interface to the experimental Perl compiler suite.
1N/A
1N/A=back
1N/A
1N/A=head2 SEE ALSO
1N/A
1N/AL<perldoc|perldoc>, L<pod2man|pod2man>, L<perlpod>,
1N/AL<pod2html|pod2html>, L<pod2usage|pod2usage>, L<podselect|podselect>,
1N/AL<podchecker|podchecker>, L<splain|splain>, L<perldiag>,
1N/AL<roffitall|roffitall>, L<a2p|a2p>, L<s2p|s2p>, L<find2perl|find2perl>,
1N/AL<File::Find|File::Find>, L<pl2pm|pl2pm>, L<perlbug|perlbug>,
1N/AL<h2ph|h2ph>, L<c2ph|c2ph>, L<h2xs|h2xs>, L<dprofpp|dprofpp>,
1N/AL<Devel::DProf>, L<perlcc|perlcc>
1N/A
1N/A=cut