![]() |
|
![]() |
Create an abbreviation table from a list Usage: %foo = (); &abbrev(*foo,LIST); ... $long = $foo{$short};
This module is a "pure virtual base class"--it has nothing of its own. It's just there to inherit from one of the various DBM packages. It prefers ndbm for compatibility reasons with Perl 4, then Berkeley DB (See L), GDBM, SDBM (which is always there--it comes with Perl), and finally ODBM. This way old programs that used to use NDBM via dbmopen() can still do so, but new ones can reorder @ISA: @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File); Note, however, that an explicit use overrides the specified order: use GDBM_File; @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File); will only find GDBM_File. Having multiple DBM implementations makes it trivial to copy database formats: use POSIX; use NDBM_File; use DB_File; tie %newhash, DB_File, $new_filename, O_CREAT|O_RDWR; tie %oldhash, NDBM_File, $old_filename, 1, 0; %newhash = %oldhash;
Usage: &assert('@x > @y'); &assert('$var > 10', $var, $othervar, @various_info); That is, if the first expression evals false, we blow up. The rest of the args, if any, are nice to know because they will be printed out by &panic, which is just the stack-backtrace routine shamelessly borrowed from the perl debugger.
Load functions only on demand
This function will split up your program into files that the AutoLoader module can handle. Normally only used to build autoloading Perl library modules, especially extensions (like POSIX). You should look at how they're built out for details.
The Benchmark module encapsulates a number of routines to help you figure out how long it takes to execute some code.
Warn or die of errors (from perspective of caller)
Run many filetest checks on a tree
Compare 8-bit scalar data according to the current locale
Access Perl configuration option
Get pathname of current working directory
Dynamically load C libraries into Perl code
Use nice English (or awk) names for ugly punctuation variables
Perl module that imports environment variables
Module to control namespace manipulations
Load the C Fcntl.h defines
Supply object methods for filehandles
Traverse a file tree
Traverse a directory structure depth-first
Basic and extended getopt(3) processing
Perl pragma to compute arithmetic in integer instead of double
Perl pragma to request less of something from the compiler
Generate a Makefile for Perl extension
Open a process for both reading and writing
Open a process for reading, writing, and error handling
Perl interface to IEEE 1003.1 namespace
Check a host for upness
Perl pragma to enable stack backtrace on unexpected signals
Load the C socket.h defines
Perl pragma to restrict unsafe constructs
Perl pragma to predeclare sub names