stored in the readonly-variable C<%Config>, indexed by their names.
Values stored in config.sh as 'undef' are returned as undefined
-values. The perl C<exists> function can be used to check is a
+values. The perl C<exists> function can be used to check if a
named variable exists.
=over 4
DynaLoader - Dynamically load C libraries into Perl code
-dl_error(), dl_findfile(), dl_expandspec(), dl_load_file(), dl_find_symbol(), dl_undef_symbols(), dl_install_xsub(), boostrap() - routines used by DynaLoader modules
+dl_error(), dl_findfile(), dl_expandspec(), dl_load_file(), dl_find_symbol(), dl_undef_symbols(), dl_install_xsub(), bootstrap() - routines used by DynaLoader modules
=head1 SYNOPSIS
$filename is not defined then "DynaLoader" will be used.
-=item boostrap()
+=item bootstrap()
Syntax:
whitespace or other special characters, and the second parameter is
the open mode, optionally followed by a file permission value.
-If C<FileHandle::open> receives a Perl mode string (">", "+<", etc.)
+If C<FileHandle::open> receives a Perl mode string ("E<gt>", "+E<lt>", etc.)
or a POSIX fopen() mode string ("w", "r+", etc.), it uses the basic
Perl C<open> operator.
=over
-=item $fh->print
+=item $fh-E<gt>print
See L<perlfunc/print>.
-=item $fh->printf
+=item $fh-E<gt>printf
See L<perlfunc/printf>.
-=item $fh->getline
+=item $fh-E<gt>getline
-This works like <$fh> described in L<perlop/"I/O Operators">
+This works like E<lt>$fhE<gt> described in L<perlop/"I/O Operators">
except that it's more readable and can be safely called in an
array context but still returns just one line.
-=item $fh->getlines
+=item $fh-E<gt>getlines
-This works like <$fh> when called in an array context to
+This works like E<lt>$fhE<gt> when called in an array context to
read all the remaining lines in a file, except that it's more readable.
It will also croak() if accidentally called in a scalar context.
The default operator mask for a newly created compartment is
the ':default' optag.
-It is important that you read the L<Opcode(3)> module documentation
-for more information. Especially for details definitions of opnames,
+It is important that you read the Opcode(3) module documentation
+for more information, especially for detailed definitions of opnames,
optags and opsets.
Since it is only at the compilation stage that the operator mask
Consider a function foo() in package pkg compiled outside a compartment
but shared with it. Assume the compartment has a root package called
-'Root'. If foo() contains an eval statement like eval '$baz = 1' then,
+'Root'. If foo() contains an eval statement like eval '$foo = 1' then,
normally, $pkg::foo will be set to 1. If foo() is called from the
compartment (by whatever means) then instead of setting $pkg::foo, the
eval will actually set $Root::pkg::foo.
mbeattie@sable.ox.ac.uk.
Reworked to use the Opcode module and other changes added by Tim Bunce
-<Tim.Bunce@ig.co.uk>.
+E<lt>F<Tim.Bunce@ig.co.uk>E<gt>.
=cut
=item sockaddr_un SOCKADDR_UN
In an array context, unpacks its SOCKADDR_UN argument and returns an array
-consisting of (PATHNAME). In a scalar context, packs its PATHANE
+consisting of (PATHNAME). In a scalar context, packs its PATHNAME
arguments as a SOCKADDR_UN and returns it. If this is confusing, use
pack_sockaddr_un() and unpack_sockaddr_un() explicitly.
-These are only supported if your system has <sys/un.h>.
+These are only supported if your system has E<lt>F<sys/un.h>E<gt>.
=item pack_sockaddr_un PATH
# Install the pods for library modules.
runpod2man('lib', $man3dir, $man3ext);
+# Install the pods embedded in the installed scripts
+runpod2man('utils', $man1dir, $man1ext, 'c2ph');
+runpod2man('utils', $man1dir, $man1ext, 'h2ph');
+runpod2man('utils', $man1dir, $man1ext, 'h2xs');
+runpod2man('utils', $man1dir, $man1ext, 'perldoc');
+runpod2man('utils', $man1dir, $man1ext, 'pl2pm');
+runpod2man('x2p', $man1dir, $man1ext, 's2p');
+runpod2man('x2p', $man1dir, $man1ext, 'a2p.pod');
+runpod2man('pod', $man1dir, $man1ext, 'pod2man');
+
+# It would probably be better to have this page linked
+# to the c2ph man page. Or, this one could say ".so man1/c2ph.1",
+# but then it would have to pay attention to $man1dir and $man1ext.
+runpod2man('utils', $man1dir, $man1ext, 'pstruct');
+
+runpod2man('lib/ExtUtils', $man1dir, $man1ext, 'xsubpp');
+
sub runpod2man {
- my($poddir, $mandir, $manext) = @_;
+ # $script is script name if we are installing a manpage embedded
+ # in a script, undef otherwise
+ my($poddir, $mandir, $manext, $script) = @_;
+
+ my($downdir); # can't just use .. when installing xsubpp manpage
+
+ $downdir = $poddir;
+ $downdir =~ s:[^/]+:..:g;
my($builddir) = Cwd::getcwd();
if ($mandir eq ' ' or $mandir eq '') {
- print STDERR "Skipping installation of $poddir man pages.\n";
+ print STDERR "Skipping installation of ",
+ ($script ? "$poddir/$script man page" : "$poddir man pages"), ".\n";
return;
}
- chdir $poddir || die "Unable to cd to $poddir directory!\n$!\n";
print STDERR "chdir $poddir\n";
+ chdir $poddir || die "Unable to cd to $poddir directory!\n$!\n";
# We insist on using the current version of pod2man in case there
# are enhancements or changes from previous installed versions.
# The error message doesn't include the '..' because the user
# won't be aware that we've chdir to $poddir.
- -r "../pod/pod2man" || die "Executable pod/pod2man not found.\n";
+ -r "$downdir/pod/pod2man" || die "Executable pod/pod2man not found.\n";
# We want to be sure to use the current perl. We can't rely on
# the installed perl because it might not be actually installed
# yet. (The user may have set the $install* Configure variables
# to point to some temporary home, from which the executable gets
# installed by occult means.)
- $pod2man = "../perl -I ../lib ../pod/pod2man --section=$manext --official";
+ $pod2man = "$downdir/perl -I $downdir/lib $downdir/pod/pod2man --section=$manext --official";
mkpath($mandir, 1, 0777) unless $notify; # In File::Path
# Make a list of all the .pm and .pod files in the directory. We will
# always run pod2man from the lib directory and feed it the full pathname
# of the pod. This might be useful for pod2man someday.
- @modpods = ();
- find(\&lsmodpods, '.');
+ if ($script) {
+ @modpods = ($script);
+ } else {
+ @modpods = ();
+ find(\&lsmodpods, '.');
+ }
foreach $mod (@modpods) {
$manpage = $mod;
my $tmp;
umask 022;
-@scripts = qw( utils/c2ph utils/h2ph utils/h2xs utils/pstruct
- utils/perlbug utils/perldoc
+@scripts = qw( utils/c2ph utils/h2ph utils/h2xs
+ utils/perlbug utils/perldoc utils/pl2pm
x2p/s2p x2p/find2perl
pod/pod2man pod/pod2html pod/pod2latex pod/pod2text);
-# pod documentation now handled by separate installman script.
-# These two are archaic leftovers.
-@manpages = qw(x2p/a2p.man x2p/s2p.man);
-
@pods = (<pod/*.pod>);
$ver = $];
s#.*/##; &chmod(0755, "$installscript/$_");
}
+# pstruct should be a link to c2ph
+
+&safe_unlink("$installscript/pstruct");
+&link("$installscript/c2ph","$installscript/pstruct");
+
# Install pod pages. Where? I guess in $installprivlib/pod.
mkpath("${installprivlib}/pod", 1, 0777);
foreach $file (@pods) {
cp_if_diff($file, "${installprivlib}/${file}");
}
-# Install old man pages.
-
-if ($installman1dir ne '') {
- mkpath($installman1dir, 1, 0777);
-
- if (! &samepath($installman1dir, '.')) {
- for (@manpages) {
- ($new = $_) =~ s/man$/$man1ext/;
- $new =~ s#.*/##;
- print STDERR " Installing $installman1dir/$new\n";
- next if $nonono;
- open(MI,$_) || warn "Can't open $_: $!\n";
- open(MO,">$installman1dir/$new") ||
- warn "Can't install $installman1dir/$new: $!\n";
- print MO ".ds RP Release $release Patchlevel $patchlevel\n";
- while (<MI>) {
- print MO;
- }
- close MI;
- close MO;
- }
- }
-}
-
# Install library files.
$do_installarchlib = $do_installprivlib = 0;
If you ask to override your chdir() built-in function, then your PWD
environment variable will be kept up to date. (See
L<perlsub/Overriding builtin functions>.) Note that it will only be
-kept up to date it all packages which use chdir import it from Cwd.
+kept up to date if all packages which use chdir import it from Cwd.
=cut
work with autoloading, you need to ensure stubs are loaded.
The SelfLoader can load stubs automatically at module initialization
-with the statement 'SelfLoader->load_stubs()';, but you may wish to
+with the statement 'SelfLoader-E<gt>load_stubs()';, but you may wish to
avoid having the stub loading overhead associated with your
initialization (though note that the SelfLoader::load_stubs method
will be called sooner or later - at latest when the first sub
=head1 AUTHOR
-Chip Salzenberg <chip@fin.uucp>
+Chip Salzenberg E<lt>F<chip@fin.uucp>E<gt>
=cut
common symbol names to reduce the risk of name clashes.
Generally anything not exported is still accessible from outside the
-module using the ModuleName::item_name (or $blessed_ref->method)
+module using the ModuleName::item_name (or $blessed_ref-E<gt>method)
syntax. By convention you can use a leading underscore on names to
informally indicate that they are 'internal' and not for public use.
=head2 Module Version Checking
The Exporter module will convert an attempt to import a number from a
-module into a call to $module_name->require_version($value). This can
+module into a call to $module_name-E<gt>require_version($value). This can
be used to validate that the version of the module being used is
greater than or equal to the required version.
There are two keys with a special meaning in the hash: "read" and
"write". After the copying is done, install will write the list of
-target files to the file named by $hashref->{write}. If there is
-another file named by $hashref->{read}, the contents of this file will
+target files to the file named by C<$hashref-E<gt>{write}>. If there is
+another file named by C<$hashref-E<gt>{read}>, the contents of this file will
be merged into the written file. The read and the written file may be
identical, but on AFS it is quite likely, people are installing to a
different directory than the one where the files later appear.
ExtUtils::MM_Unix.
If you are going to write a platform specific MM package, please try
-to limit the necessary overrides to primitiv methods, and if it is not
-possible to do so, let's work it out how to achieve that gain.
+to limit the necessary overrides to primitive methods, and if it is not
+possible to do so, let's work out how to achieve that gain.
If you are overriding any of these methods in your Makefile.PL (in the
MY class), please report that to the makemaker mailing list. We are
Not all of the methods below are overridable in a
Makefile.PL. Overridable methods are marked as (o). All methods are
overridable by a platform specific MM_*.pm file (See
-L<ExtUtils::MM_VMS>) and L<ExtUtils::MM_OS2>).
+L<ExtUtils::MM_VMS> and L<ExtUtils::MM_OS2>).
=head2 Preloaded methods
=item file_name_is_absolute
-Takes as argument a path and returns true, it it is an absolute path.
+Takes as argument a path and returns true, if it is an absolute path.
=cut
=item post_initialize (o)
-Returns an ampty string per default. Used in Makefile.PLs to add some
+Returns an empty string per default. Used in Makefile.PLs to add some
chunk of text to the Makefile after the object is initialized.
=cut
=item CONFIGURE
CODE reference. The subroutine should return a hash reference. The
-hash may contain further attributes, e.g. {LIBS => ...}, that have to
+hash may contain further attributes, e.g. {LIBS =E<gt> ...}, that have to
be determined by some evaluation method.
=item DEFINE
=head1 DESCRIPTION
C<ExtUtils::Mksymlists> produces files used by the linker under some OSs
-during the creation of shared libraries for synamic extensions. It is
+during the creation of shared libraries for dynamic extensions. It is
normally called from a MakeMaker-generated Makefile when the extension
is built. The linker option file is generated by calling the function
C<Mksymlists>, which is exported by default from C<ExtUtils::Mksymlists>.
returns, not the newly created version.)
The third parameter is an integer flag, which tells C<rmscopy>
-how to handle timestamps. If it is < 0, none of the input file's
-timestamps are propagated to the output file. If it is > 0, then
+how to handle timestamps. If it is E<lt> 0, none of the input file's
+timestamps are propagated to the output file. If it is E<gt> 0, then
it is interpreted as a bitmask: if bit 0 (the LSB) is set, then
timestamps other than the revision date are propagated; if bit 1
is set, the revision date is propagated. If the third parameter
=head1 AUTHORS
-Tim Bunce <Tim.Bunce@ig.co.uk>
-Charles Bailey <bailey@genetics.upenn.edu>
+Tim Bunce E<lt>F<Tim.Bunce@ig.co.uk>E<gt>
+Charles Bailey E<lt>F<bailey@genetics.upenn.edu>E<gt>
=head1 REVISION
of paths relative to the bin directory.
This allows a user to setup a directory tree for some software with
-directories <root>/bin and <root>/lib and then the above example will allow
+directories E<lt>rootE<gt>/bin and E<lt>rootE<gt>/lib and then the above example will allow
the use of modules in the lib directory without knowing where the software
tree is installed.
=head1 AUTHORS
-Graham Barr <bodg@tiuk.ti.com>
-Nick Ing-Simmons <nik@tiuk.ti.com>
+Graham Barr E<lt>F<bodg@tiuk.ti.com>E<gt>
+Nick Ing-Simmons E<lt>F<nik@tiuk.ti.com>E<gt>
=head1 COPYRIGHT
=over 8
-=item <none>
+=item E<lt>noneE<gt>
Option does not take an argument.
The option variable will be set to 1.
The option name may actually be a list of option names, separated by
"|"s, e.g. "foo|bar|blech=s". In this example, "foo" is the true name
-op this option. If no linkage is specified, options "foo", "bar" and
+of this option. If no linkage is specified, options "foo", "bar" and
"blech" all will set $opt_foo.
Option names may be abbreviated to uniqueness, depending on
=head2 Non-option call-back routine
-A special option specifier, <>, can be used to designate a subroutine
+A special option specifier, E<lt>E<gt>, can be used to designate a subroutine
to handle non-option arguments. GetOptions will immediately call this
subroutine for every non-option it encounters in the options list.
This subroutine gets the name of the non-option passed.
--bar= -> $opt_bar = ''
--bar=-- -> $opt_bar = '--'
-Example of using variabel references:
+Example of using variable references:
$ret = &GetOptions ('foo=s', \$foo, 'bar=i', 'ar=s', \@ar);
With command line options "-foo blech -bar 24 -ar xx -ar yy"
this will result in:
- $bar = 'blech'
+ $foo = 'blech'
$opt_bar = 24
@ar = ('xx','yy')
-Example of using the <> option specifier:
+Example of using the E<lt>E<gt> option specifier:
@ARGV = qw(-foo 1 bar -foo 2 blech);
&GetOptions("foo=i", \$myfoo, "<>", \&mysub);
reading and $wtr for writing. It's what you think should work
when you try
- open(HANDLE, "|cmd args");
+ open(HANDLE, "|cmd args|");
open2() returns the process ID of the child process. It doesn't return on
failure: it just raises an exception matching C</^open2:/>.
ERRFH is '', or the same as RDRFH, then STDOUT and STDERR of the child are
on the same file handle.
-If WTRFH begins with "<&", then WTRFH will be closed in the parent, and
+If WTRFH begins with "E<lt>&", then WTRFH will be closed in the parent, and
the child will read from it directly. If RDRFH or ERRFH begins with
-">&", then the child will send output directly to that file handle. In both
+"E<gt>&", then the child will send output directly to that file handle. In both
cases, there will be a dup(2) instead of a pipe(2) made.
If you try to read from the child's stdout writer and their stderr
Pod::Text.
The single function C<pod2text()> can take one or two arguments. The first
-should be the name of a file to read the pod from, or "<&STDIN" to read from
+should be the name of a file to read the pod from, or "E<lt>&STDIN" to read from
STDIN. A second argument, if provided, should be a filehandle glob where
output should be sent.
=head1 AUTHOR
-Tom Christiansen E<lt>tchrist@mox.perl.comE<gt>
+Tom Christiansen E<lt>F<tchrist@mox.perl.com>E<gt>
=head1 TODO
the C<__DATA__> token and put your own data after those
declarations, using the C<__END__> token to mark the end
of subroutine declarations. You must also ensure that the B<SelfLoader>
-reads first by calling 'SelfLoader->load_stubs();', or by using a
+reads first by calling 'SelfLoader-E<gt>load_stubs();', or by using a
function which is selfloaded;
or
For modules which ARE classes, and need to handle inherited methods,
stubs are needed to ensure that the method inheritance mechanism works
properly. You can load the stubs into the module at 'require' time, by
-adding the statement 'SelfLoader->load_stubs();' to the module to do
+adding the statement 'SelfLoader-E<gt>load_stubs();' to the module to do
this.
The alternative is to put the stubs in before the C<__DATA__> token BEFORE
=head1 AUTHOR
-David Sundstrom <sunds@asictest.sc.ti.com>
+David Sundstrom E<lt>F<sunds@asictest.sc.ti.com>E<gt>
Texas Instruments
=over 4
-=item <tab>
+=item E<lt>tabE<gt>
Attempts word completion.
Cannot be changed.
Erases the current input.
Defined by I<$Term::Complete::kill>.
-=item <del>, <bs>
+=item E<lt>delE<gt>, E<lt>bsE<gt>
Erases one character.
Defined by I<$Term::Complete::erase1> and I<$Term::Complete::erase2>.
=head1 BUGS
-The completion charater <tab> cannot be changed.
+The completion charater E<lt>tabE<gt> cannot be changed.
=head1 AUTHOR
$term->addhistory('row');
-where $term is a return value of Term::ReadLine->Init.
+where $term is a return value of Term::ReadLine-E<gt>Init.
=over 12
=item C<findConsole>
returns an array with two strings that give most appropriate names for
-files for input and output using conventions C<"<$in">, C<"E<gt>out">.
+files for input and output using conventions C<"E<lt>$in">, C<"E<gt>out">.
=item C<Features>
=head1 NAME
-Text::Tabs -- expand and unexpand tabs per the unix expand(1) and unexpand(1)
+Text::Tabs - expand and unexpand tabs per the unix expand(1) and unexpand(1)
=head1 SYNOPSIS
-use Text::Tabs;
+ use Text::Tabs;
-$tabstop = 4;
-@lines_without_tabs = expand(@lines_with_tabs);
-@lines_with_tabs = unexpand(@lines_without_tabs);
+ $tabstop = 4;
+ @lines_without_tabs = expand(@lines_with_tabs);
+ @lines_with_tabs = unexpand(@lines_without_tabs);
=head1 DESCRIPTION
=head1 AUTHOR
-David Muir Sharnoff <muir@idiom.com>
+David Muir Sharnoff E<lt>F<muir@idiom.com>E<gt>
=head1 AUTHOR
-David Muir Sharnoff <muir@idiom.com>
+David Muir Sharnoff E<lt>F<muir@idiom.com>E<gt>
=cut
=head1 NAME
-Time::Local - efficiently compute tome from local and GMT time
+Time::Local - efficiently compute time from local and GMT time
=head1 SYNOPSIS
=head2 The C<diagnostics> Pragma
This module extends the terse diagnostics normally emitted by both the
-perl compiler and the perl interpeter, augmenting them wtih the more
+perl compiler and the perl interpeter, augmenting them with the more
explicative and endearing descriptions found in L<perldiag>. Like the
-other pragmata, it affects to compilation phase of your program rather
+other pragmata, it affects the compilation phase of your program rather
than merely the execution phase.
To use in your program as a pragma, merely invoke
disable() and enable() methods to turn them off and on respectively.
The B<-verbose> flag first prints out the L<perldiag> introduction before
-any other diagnostics. The $diagnostics::PRETTY can generate nicer escape
-sequences for pgers.
+any other diagnostics. The $diagnostics::PRETTY variable can generate nicer
+escape sequences for pagers.
=head2 The I<splain> Program
./splain < test.out
Note that this is not in general possible in shells of more dubious heritage,
-as the theorectical
+as the theoretical
(perl -w test.pl >/dev/tty) >& test.out
./splain < test.out
splain package is built. See the F<Makefile> for details.
If an extant $SIG{__WARN__} handler is discovered, it will continue
-to be honored, but only after the diagnostic::splainthis() function
+to be honored, but only after the diagnostics::splainthis() function
(the module's $SIG{__WARN__} interceptor) has had its way with your
warnings.
"atan2", "cos", "sin", "exp", "abs", "log", "sqrt",
If C<abs> is unavailable, it can be autogenerated using methods
-for "<" or "<=>" combined with either unary minus or subtraction.
+for "E<lt>" or "E<lt>=E<gt>" combined with either unary minus or subtraction.
=item * I<Boolean, string and numeric conversion>
can be expressed in terms of its "spaceship" counterpart: either
C<E<lt>=E<gt>> or C<cmp>:
-
+
<, >, <=, >=, ==, != in terms of <=>
lt, gt, le, ge, eq, ne in terms of cmp
=head1 AUTHOR
-Ilya Zakharevich <F<ilya@math.mps.ohio-state.edu>>.
+Ilya Zakharevich E<lt>F<ilya@math.mps.ohio-state.edu>E<gt>.
=head1 DIAGNOSTICS
=head2 The C<diagnostics> Pragma
This module extends the terse diagnostics normally emitted by both the
-perl compiler and the perl interpeter, augmenting them wtih the more
+perl compiler and the perl interpeter, augmenting them with the more
explicative and endearing descriptions found in L<perldiag>. Like the
-other pragmata, it affects to compilation phase of your program rather
+other pragmata, it affects the compilation phase of your program rather
than merely the execution phase.
To use in your program as a pragma, merely invoke
disable() and enable() methods to turn them off and on respectively.
The B<-verbose> flag first prints out the L<perldiag> introduction before
-any other diagnostics. The $diagnostics::PRETTY can generate nicer escape
-sequences for pgers.
+any other diagnostics. The $diagnostics::PRETTY variable can generate nicer
+escape sequences for pagers.
=head2 The I<splain> Program
./splain < test.out
Note that this is not in general possible in shells of more dubious heritage,
-as the theorectical
+as the theoretical
(perl -w test.pl >/dev/tty) >& test.out
./splain < test.out
splain package is built. See the F<Makefile> for details.
If an extant $SIG{__WARN__} handler is discovered, it will continue
-to be honored, but only after the diagnostic::splainthis() function
+to be honored, but only after the diagnostics::splainthis() function
(the module's $SIG{__WARN__} interceptor) has had its way with your
warnings.
This disables the poetry optimization, generating a compile-time error if
you try to use a bareword identifier that's not a subroutine, unless it
-appears in curly braces or on the left hand side of the "=>" symbol.
+appears in curly braces or on the left hand side of the "=E<gt>" symbol.
use strict 'subs';
use Cwd;
@pods = qw{
- perl perldata perlsyn perlop perlre perlrun perlfunc perlvar
- perlsub perlmod perlref perldsc perllol perlobj perltie
- perlbot perldebug perldiag perlform perlipc perlsec perltrap
- perlstyle perlxs perlxstut perlguts perlcall perlembed perlpod
- perlbook
+ perl
+ perldata perlsyn perlop perlre perlrun perlfunc perlvar
+ perlsub perlmod perlform
+ perlref perldsc perllol perlobj perltie perlbot perlipc
+ perldebug perldiag perlsec perltrap perlstyle
+ perlpod perlbook
+ perlembed perlapio perlxs perlxstut perlguts perlcall
};
for (@pods) { s/$/.pod/ }
=head1 AUXILIARY DOCUMENTATION
- Here should be listed all the extra program's docs, but they
+ Here should be listed all the extra programs' docs, but they
don't all have man pages yet:
=item a2p
# calling a function that returns a key,value list, like
# "lead","fred","daughter","pebbles"
- while ( %fields = getnextpairset() )
+ while ( %fields = getnextpairset() ) {
push @LoH, { %fields };
}
}
}
- # calling a function that returns a key,value list, like
- # "lead","fred","daughter","pebbles"
- while ( %fields = getnextpairset() )
- push @a, { %fields };
- }
-
# calling a function that returns a key,value hash
for $group ( "simpsons", "jetsons", "flintstones" ) {
$HoH{$group} = { get_family($group) };
# print the whole thing
foreach $family ( keys %HoH ) {
- print "$family: ";
+ print "$family: { ";
for $role ( keys %{ $HoH{$family} } ) {
print "$role=$HoH{$family}{$role} ";
}
# print the whole thing somewhat sorted
foreach $family ( sort keys %HoH ) {
- print "$family: ";
+ print "$family: { ";
for $role ( sort keys %{ $HoH{$family} } ) {
print "$role=$HoH{$family}{$role} ";
}
# print the whole thing sorted by number of members
foreach $family ( sort { keys %{$HoH{$b}} <=> keys %{$HoH{$b}} } keys %HoH ) {
- print "$family: ";
+ print "$family: { ";
for $role ( sort keys %{ $HoH{$family} } ) {
print "$role=$HoH{$family}{$role} ";
}
# now print the whole thing sorted by number of members
foreach $family ( sort { keys %{$HoH{$b}} <=> keys %{$HoH{$b}} } keys %HoH ) {
- print "$family: ";
+ print "$family: { ";
# and print these according to rank order
- for $role ( sort { $rank{$a} <=> $rank{$b} keys %{ $HoH{$family} } ) {
+ for $role ( sort { $rank{$a} <=> $rank{$b} keys %{ $HoH{$family} } } ) {
print "$role=$HoH{$family}{$role} ";
}
print "}\n";
@members = ();
# assume this file in field=value syntax
- while () {
+ while (<>) {
%fields = split /[\s=]+/;
push @members, { %fields };
}
=head1 SEE ALSO
-L<perlref>, L<perllol>, L<perldata>, L<perlobj>
+perlref(1), perllol(1), perldata(1), perlobj(1)
=head1 AUTHOR
of variable interpolation. The at field (not to be confused with the array
marker @) is the normal kind of field; the other kind, caret fields, are used
to do rudimentary multi-line text block filling. The length of the field
-is supplied by padding out the field with multiple "<", ">", or "|"
+is supplied by padding out the field with multiple "E<lt>", "E<gt>", or "|"
characters to specify, respectively, left justification, right
justification, or centering. If the variable would exceed the width
specified, it is truncated.
.
It is possible to intermix print()s with write()s on the same output
-channel, but you'll have to handle $- ($FORMAT_LINES_LEFT)
+channel, but you'll have to handle C<$-> (C<$FORMAT_LINES_LEFT>)
yourself.
=head2 Format Variables
-The current format name is stored in the variable C<$~> ($FORMAT_NAME),
-and the current top of form format name is in C<$^> ($FORMAT_TOP_NAME).
-The current output page number is stored in C<$%> ($FORMAT_PAGE_NUMBER),
-and the number of lines on the page is in C<$=> ($FORMAT_LINES_PER_PAGE).
+The current format name is stored in the variable C<$~> (C<$FORMAT_NAME>),
+and the current top of form format name is in C<$^> (C<$FORMAT_TOP_NAME>).
+The current output page number is stored in C<$%> (C<$FORMAT_PAGE_NUMBER>),
+and the number of lines on the page is in C<$=> (C<$FORMAT_LINES_PER_PAGE>).
Whether to autoflush output on this handle is stored in C<$|>
-($OUTPUT_AUTOFLUSH). The string output before each top of page (except
-the first) is stored in C<$^L> ($FORMAT_FORMFEED). These variables are
+(C<$OUTPUT_AUTOFLUSH>). The string output before each top of page (except
+the first) is stored in C<$^L> (C<$FORMAT_FORMFEED>). These variables are
set on a per-filehandle basis, so you'll need to select() into a different
one to affect them:
structures.
A list of lists, or an array of an array if you would, is just a regular
-old array @LoL that you can get at with two subscripts, like $LoL[3][2]. Here's
+old array @LoL that you can get at with two subscripts, like C<$LoL[3][2]>. Here's
a declaration of the array:
# assign to our array a list of list references
Notice that the outer bracket type has changed, and so our access syntax
has also changed. That's because unlike C, in perl you can't freely
interchange arrays and references thereto. $ref_to_LoL is a reference to an
-array, whereas @LoL is an array proper. Likewise, $LoL[2] is not an
+array, whereas @LoL is an array proper. Likewise, C<$LoL[2]> is not an
array, but an array ref. So how come you can write these:
$LoL[2][2]
$ref_to_LoL->[2]->[2]
Well, that's because the rule is that on adjacent brackets only (whether
-square or curly), you are free to omit the pointer dereferencing array.
+square or curly), you are free to omit the pointer dereferencing arrow.
But you cannot do so for the very first one if it's a scalar containing
a reference, which means that $ref_to_LoL always needs it.
if you knew where you wanted to put it:
my (@LoL, $i, $line);
- for $i ( 0 .. 10 )
+ for $i ( 0 .. 10 ) {
$line = <>;
$LoL[$i] = [ split ' ', $line ];
}
or even just
my (@LoL, $i);
- for $i ( 0 .. 10 )
+ for $i ( 0 .. 10 ) {
$LoL[$i] = [ split ' ', <> ];
}
This would be clearer to the casual reader:
my (@LoL, $i);
- for $i ( 0 .. 10 )
+ for $i ( 0 .. 10 ) {
$LoL[$i] = [ split ' ', scalar(<>) ];
}
=head1 AUTHOR
-Tom Christiansen <tchrist@perl.com>
+Tom Christiansen E<lt>F<tchrist@perl.com>E<gt>
Last udpate: Sat Oct 7 19:35:26 MDT 1995
return $self;
}
-If you care about inheritance (and you should; see L<perlmod/"Modules:
-Creation, Use and Abuse">), then you want to use the two-arg form of bless
+If you care about inheritance (and you should; see
+L<perlmod/"Modules: Creation, Use and Abuse">),
+then you want to use the two-arg form of bless
so that your constructors may be inherited:
sub new {
=item B<-I>I<directory>
Directories specified by B<-I> are prepended to the search path for
-modules (@INC), and also tells the C preprocessor where to search for
+modules (C<@INC>), and also tells the C preprocessor where to search for
include files. The C preprocessor is invoked with B<-P>; by default it
searches /usr/include and /usr/lib/perl.
gnufind / -print0 | perl -ln0e 'print "found $_" if -p'
-This sets $\ to newline and then sets $/ to the null character.
+This sets C<$\> to newline and then sets C<$/> to the null character.
=item B<-m>[B<->]I<module>
=head2 Cleaning Up Your Path
-For "Insecure $ENV{PATH}" messages, you need to set C<$ENV{'PATH'}> to a
+For "Insecure C<$ENV{PATH}>" messages, you need to set C<$ENV{'PATH'}> to a
known value, and each directory in the path must be non-writable by others
than its owner and group. You may be surprised to get this message even
if the pathname to your executable is fully qualified. This is I<not>
Perl does not have named formal parameters, but in practice all you do is
assign to a my() list of these. Any variables you use in the function
that aren't declared private are global variables. For the gory details
-on creating private variables, see the sections below on
+on creating private variables, see
L<"Private Variables via my()"> and L<"Temporary Values via local()">.
To create protected environments for a set of functions in a separate
package (and probably a separate file), see L<perlmod/"Packages">.
This also has the effect of turning call-by-reference into call-by-value,
since the assignment copies the values. Otherwise a function is free to
-do in-place modifications of @_ and change its callers values.
+do in-place modifications of @_ and change its caller's values.
upcase_in($v1, $v2); # this changes $v1 and $v2
sub upcase_in {
local *merlyn = \$randal; # just alias $merlyn, not @merlyn etc
A local() modifies its listed variables to be local to the enclosing
-block, (or subroutine, C<eval{}> or C<do>) and I<the any called from
+block, (or subroutine, C<eval{}> or C<do>) and I<any called from
within that block>. A local() just gives temporary values to global
(meaning package) variables. This is known as dynamic scoping. Lexical
scoping is done with "my", which works more like C's auto declarations.
}
# old %digits restored here
-Because local() is a run-time command, and so gets executed every time
+Because local() is a run-time command, it gets executed every time
through a loop. In releases of Perl previous to 5.0, this used more stack
storage each time until the loop was exited. Perl now reclaims the space
each time through, but it's still more efficient to declare your variables
Note that scalars are already passed by reference, so you can modify
scalar arguments without using this mechanism by referring explicitly
-to $_[0] etc. You can modify all the elements of an array by passing
+to C<$_[0]> etc. You can modify all the elements of an array by passing
all the elements as scalars, but you have to use the * mechanism (or
the equivalent reference mechanism) to push, pop or change the size of
an array. It will certainly be faster to pass the typeglob (or reference).
=head1 NAME
-c2ph,pstruct - Dump C structures as generated from 'cc -g -S' stabs
+c2ph, pstruct - Dump C structures as generated from C<cc -g -S> stabs
=head1 SYNOPSIS
the format it is going to massage them into anyway, and spits out
listings like this:
-struct tty {
- int tty.t_locker 000 4
- int tty.t_mutex_index 004 4
- struct tty * tty.t_tp_virt 008 4
- struct clist tty.t_rawq 00c 20
- int tty.t_rawq.c_cc 00c 4
- int tty.t_rawq.c_cmax 010 4
- int tty.t_rawq.c_cfx 014 4
- int tty.t_rawq.c_clx 018 4
- struct tty * tty.t_rawq.c_tp_cpu 01c 4
- struct tty * tty.t_rawq.c_tp_iop 020 4
- unsigned char * tty.t_rawq.c_buf_cpu 024 4
- unsigned char * tty.t_rawq.c_buf_iop 028 4
- struct clist tty.t_canq 02c 20
- int tty.t_canq.c_cc 02c 4
- int tty.t_canq.c_cmax 030 4
- int tty.t_canq.c_cfx 034 4
- int tty.t_canq.c_clx 038 4
- struct tty * tty.t_canq.c_tp_cpu 03c 4
- struct tty * tty.t_canq.c_tp_iop 040 4
- unsigned char * tty.t_canq.c_buf_cpu 044 4
- unsigned char * tty.t_canq.c_buf_iop 048 4
- struct clist tty.t_outq 04c 20
- int tty.t_outq.c_cc 04c 4
- int tty.t_outq.c_cmax 050 4
- int tty.t_outq.c_cfx 054 4
- int tty.t_outq.c_clx 058 4
- struct tty * tty.t_outq.c_tp_cpu 05c 4
- struct tty * tty.t_outq.c_tp_iop 060 4
- unsigned char * tty.t_outq.c_buf_cpu 064 4
- unsigned char * tty.t_outq.c_buf_iop 068 4
- (*int)() tty.t_oproc_cpu 06c 4
- (*int)() tty.t_oproc_iop 070 4
- (*int)() tty.t_stopproc_cpu 074 4
- (*int)() tty.t_stopproc_iop 078 4
- struct thread * tty.t_rsel 07c 4
-
- etc.
+ struct tty {
+ int tty.t_locker 000 4
+ int tty.t_mutex_index 004 4
+ struct tty * tty.t_tp_virt 008 4
+ struct clist tty.t_rawq 00c 20
+ int tty.t_rawq.c_cc 00c 4
+ int tty.t_rawq.c_cmax 010 4
+ int tty.t_rawq.c_cfx 014 4
+ int tty.t_rawq.c_clx 018 4
+ struct tty * tty.t_rawq.c_tp_cpu 01c 4
+ struct tty * tty.t_rawq.c_tp_iop 020 4
+ unsigned char * tty.t_rawq.c_buf_cpu 024 4
+ unsigned char * tty.t_rawq.c_buf_iop 028 4
+ struct clist tty.t_canq 02c 20
+ int tty.t_canq.c_cc 02c 4
+ int tty.t_canq.c_cmax 030 4
+ int tty.t_canq.c_cfx 034 4
+ int tty.t_canq.c_clx 038 4
+ struct tty * tty.t_canq.c_tp_cpu 03c 4
+ struct tty * tty.t_canq.c_tp_iop 040 4
+ unsigned char * tty.t_canq.c_buf_cpu 044 4
+ unsigned char * tty.t_canq.c_buf_iop 048 4
+ struct clist tty.t_outq 04c 20
+ int tty.t_outq.c_cc 04c 4
+ int tty.t_outq.c_cmax 050 4
+ int tty.t_outq.c_cfx 054 4
+ int tty.t_outq.c_clx 058 4
+ struct tty * tty.t_outq.c_tp_cpu 05c 4
+ struct tty * tty.t_outq.c_tp_iop 060 4
+ unsigned char * tty.t_outq.c_buf_cpu 064 4
+ unsigned char * tty.t_outq.c_buf_iop 068 4
+ (*int)() tty.t_oproc_cpu 06c 4
+ (*int)() tty.t_oproc_iop 070 4
+ (*int)() tty.t_stopproc_cpu 074 4
+ (*int)() tty.t_stopproc_iop 078 4
+ struct thread * tty.t_rsel 07c 4
+
+etc.
Actually, this was generated by a particular set of options. You can control
leading zeroes or whatever.
All you need to be able to use this is a C compiler than generates
-BSD/GCC-style stabs. The -g option on native BSD compilers and GCC
+BSD/GCC-style stabs. The B<-g> option on native BSD compilers and GCC
should get this for you.
-To learn more, just type a bogus option, like -\?, and a long usage message
+To learn more, just type a bogus option, like B<-\?>, and a long usage message
will be provided. There are a fair number of possibilities.
If you're only a C programmer, than this is the end of the message for you.
As you see, the name of the package is the name of the structure. Regular
-fields are just their own names. Plus the follwoing accessor functions are
+fields are just their own names. Plus the following accessor functions are
provided for your convenience:
struct This takes no arguments, and is merely the number of first-level
Anyway, here it is. Should run on perl v4 or greater. Maybe less.
---tom
+ --tom
=cut
eval 'exec perl -S \$0 "\$@"'
if 0;
-'di ';
-'ds 00 \"';
-'ig 00 ';
-
!GROK!THIS!
# In the following, perl variables are not expanded during extraction.
}
}
##############################################################################
+__END__
+
+=head1 NAME
+
+h2ph - convert .h C header files to .ph Perl header files
+
+=head1 SYNOPSIS
+
+B<h2ph [headerfiles]>
+
+=head1 DESCRIPTION
- # These next few lines are legal in both Perl and nroff.
-
-.00 ; # finish .ig
-
-'di \" finish diversion--previous line must be blank
-.nr nl 0-1 \" fake up transition to first page again
-.nr % 0 \" start at page 1
-'; __END__ ############# From here on it's a standard manual page ############
-.TH H2PH 1 "August 8, 1990"
-.AT 3
-.SH NAME
-h2ph \- convert .h C header files to .ph Perl header files
-.SH SYNOPSIS
-.B h2ph [headerfiles]
-.SH DESCRIPTION
-.I h2ph
+I<h2ph>
converts any C header files specified to the corresponding Perl header file
format.
It is most easily run while in /usr/include:
-.nf
cd /usr/include; h2ph * sys/*
-.fi
If run with no arguments, filters standard input to standard output.
-.SH ENVIRONMENT
+
+=head1 ENVIRONMENT
+
No environment variables are used.
-.SH FILES
-/usr/include/*.h
-.br
-/usr/include/sys/*.h
-.br
+
+=head1 FILES
+
+ /usr/include/*.h
+ /usr/include/sys/*.h
+
etc.
-.SH AUTHOR
+
+=head1 AUTHOR
+
Larry Wall
-.SH "SEE ALSO"
+
+=head1 SEE ALSO
+
perl(1)
-.SH DIAGNOSTICS
+
+=head1 DIAGNOSTICS
+
The usual warnings if it can't read or write the files involved.
-.SH BUGS
+
+=head1 BUGS
+
Doesn't construct the %sizeof array for you.
-.PP
+
It doesn't handle all C constructs, but it does attempt to isolate
definitions inside evals so that you can get at the definitions
that it can translate.
-.PP
+
It's only intended as a rough tool.
You may need to dicker with the files produced.
-.ex
+
+=cut
+
!NO!SUBS!
close OUT or die "Can't close $file: $!";