print CONFIG <<EOF;
=head2 $c
-=over
+=over 4
EOF
$text = 1;
through the assembler and outputting bytecode.
=item B<-upackage>
-
+
Stores package in the output.
-
+
=back
=head1 EXAMPLES
=head1 SYNOPSIS
- use DB_File ;
-
+ use DB_File;
+
[$X =] tie %hash, 'DB_File', [$filename, $flags, $mode, $DB_HASH] ;
[$X =] tie %hash, 'DB_File', $filename, $flags, $mode, $DB_BTREE ;
[$X =] tie @array, 'DB_File', $filename, $flags, $mode, $DB_RECNO ;
here is the output:
Banana Exists
-
+
orange -> orange
tomato -> red
banana -> yellow
$filename = "tree" ;
unlink $filename ;
-
+
# Enable duplicate records
$DB_BTREE->{'flags'} = R_DUP ;
-
+
tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
or die "Cannot open $filename: $!\n";
-
+
# Add some key/value pairs to the file
$h{'Wall'} = 'Larry' ;
$h{'Wall'} = 'Brick' ; # Note the duplicate key
use warnings ;
use strict ;
use DB_File ;
-
+
use vars qw($filename $x %h $status $key $value) ;
$filename = "tree" ;
unlink $filename ;
-
+
# Enable duplicate records
$DB_BTREE->{'flags'} = R_DUP ;
-
+
$x = tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
or die "Cannot open $filename: $!\n";
-
+
# Add some key/value pairs to the file
$h{'Wall'} = 'Larry' ;
$h{'Wall'} = 'Brick' ; # Note the duplicate key
$h{'Wall'} = 'Brick' ; # Note the duplicate key and value
$h{'Smith'} = 'John' ;
$h{'mouse'} = 'mickey' ;
-
+
# iterate through the btree using seq
# and print each key/value pair.
$key = $value = 0 ;
$status == 0 ;
$status = $x->seq($key, $value, R_NEXT) )
{ print "$key -> $value\n" }
-
+
undef $x ;
untie %h ;
use warnings ;
use strict ;
use DB_File ;
-
+
use vars qw($filename $x %h ) ;
$filename = "tree" ;
-
+
# Enable duplicate records
$DB_BTREE->{'flags'} = R_DUP ;
-
+
$x = tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
or die "Cannot open $filename: $!\n";
@list = $x->get_dup("Smith") ;
print "Smith => [@list]\n" ;
-
+
@list = $x->get_dup("Dog") ;
print "Dog => [@list]\n" ;
use warnings ;
use strict ;
use DB_File ;
-
+
use vars qw($filename $x %h $found) ;
my $filename = "tree" ;
-
+
# Enable duplicate records
$DB_BTREE->{'flags'} = R_DUP ;
-
+
$x = tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
or die "Cannot open $filename: $!\n";
$found = ( $x->find_dup("Wall", "Larry") == 0 ? "" : "not") ;
print "Larry Wall is $found there\n" ;
-
+
$found = ( $x->find_dup("Wall", "Harry") == 0 ? "" : "not") ;
print "Harry Wall is $found there\n" ;
-
+
undef $x ;
untie %h ;
use warnings ;
use strict ;
use DB_File ;
-
+
use vars qw($filename $x %h $found) ;
my $filename = "tree" ;
-
+
# Enable duplicate records
$DB_BTREE->{'flags'} = R_DUP ;
-
+
$x = tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
or die "Cannot open $filename: $!\n";
$found = ( $x->find_dup("Wall", "Larry") == 0 ? "" : "not") ;
print "Larry Wall is $found there\n" ;
-
+
undef $x ;
untie %h ;
$x = tie %h, "DB_File", $filename, O_RDWR|O_CREAT, 0640, $DB_BTREE
or die "Cannot open $filename: $!\n";
-
+
# Add some key/value pairs to the file
$h{'mouse'} = 'mickey' ;
$h{'Wall'} = 'Larry' ;
$h{'Walls'} = 'Brick' ;
$h{'Smith'} = 'John' ;
-
+
$key = $value = 0 ;
print "IN ORDER\n" ;
for ($st = $x->seq($key, $value, R_FIRST) ;
$st == 0 ;
$st = $x->seq($key, $value, R_NEXT) )
-
+
{ print "$key -> $value\n" }
-
+
print "\nPARTIAL MATCH\n" ;
match "Wa" ;
use vars qw(@h $H $file $i) ;
use DB_File ;
use Fcntl ;
-
+
$file = "text" ;
unlink $file ;
$H = tie @h, "DB_File", $file, O_RDWR|O_CREAT, 0640, $DB_RECNO
or die "Cannot open file $file: $!\n" ;
-
+
# first create a text file to play with
$h[0] = "zero" ;
$h[1] = "one" ;
$h[3] = "three" ;
$h[4] = "four" ;
-
+
# Print the records in order.
#
# The length method is needed here because evaluating a tied
Data::Dumper - stringified perl data structures, suitable for both printing and C<eval>
-
=head1 SYNOPSIS
use Data::Dumper;
This shows that
-=over
+=over 4
=item *
Filter::Util::Call - Perl Source Filter Utility Module
=head1 SYNOPSIS
-
+
use Filter::Util::Call ;
=head1 DESCRIPTION
Here is a skeleton for the I<method filter>:
package MyFilter ;
-
+
use Filter::Util::Call ;
sub import
my($type, @arguments) = @_ ;
filter_add([]) ;
}
-
+
sub filter
{
my($self) = @_ ;
my($status) ;
-
+
$status = filter_read() ;
$status ;
}
-
+
1 ;
and this is the equivalent skeleton for the I<closure filter>:
package MyFilter ;
-
+
use Filter::Util::Call ;
sub import
{
my($type, @arguments) = @_ ;
-
+
filter_add(
sub
{
$status ;
} )
}
-
+
1 ;
To make use of either of the two filter modules above, place the line
Useful, but it is the first example and I wanted to keep it simple.
package Joe2Jim ;
-
+
use Filter::Util::Call ;
sub import
{
my($type) = @_ ;
-
+
filter_add(bless []) ;
}
-
+
sub filter
{
my($self) = @_ ;
my($status) ;
-
+
s/Joe/Jim/g
if ($status = filter_read()) > 0 ;
$status ;
}
-
+
1 ;
Here is an example of using the filter:
C<Subst>.
package Subst ;
-
+
use Filter::Util::Call ;
use Carp ;
-
+
sub import
{
croak("usage: use Subst qw(from to)")
Note that C<$status> is set to C<1> in this case.
package Count ;
-
+
use Filter::Util::Call ;
-
+
sub filter
{
my ($self) = @_ ;
my ($status) ;
-
+
if (($status = filter_read()) > 0 ) {
s/Joe/Jim/g ;
++ $$self ;
$status ;
}
-
+
sub import
{
my ($self) = @_ ;
my ($count) = 0 ;
filter_add(\$count) ;
}
-
+
1 ;
Here is a script which uses it:
Here is the module.
package NewSubst ;
-
+
use Filter::Util::Call ;
use Carp ;
-
+
sub import
{
my ($self, $start, $stop, $from, $to) = @_ ;
my ($found) = 0 ;
croak("usage: use Subst qw(start stop from to)")
unless @_ == 5 ;
-
+
filter_add(
sub
{
my ($status) ;
-
+
if (($status = filter_read()) > 0) {
-
+
$found = 1
if $found == 0 and /$start/ ;
-
+
if ($found) {
s/$from/$to/ ;
filter_del() if /$stop/ ;
}
-
+
}
$status ;
} )
-
+
}
-
+
1 ;
=head1 AUTHOR
Furthermore, for doing normal I/O you might need these:
-=over
+=over 4
=item $io->fdopen ( FD, MODE )
Lastly, there is a special method for working under B<-T> and setuid/gid
scripts:
-=over
+=over 4
=item $io->untaint
position. Returns "0 but true" on success, C<undef> on failure.
=back
-
+
See L<perlfunc> for complete descriptions of each of the following
supported C<IO::Seekable> methods, which are just front ends for the
corresponding built-in functions:
Returns the IO::File's current position, or -1 on error.
=back
-
+
=head1 SEE ALSO
L<perlfunc>,
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
-
+
As of VERSION 1.18 all IO::Socket objects have autoflush turned on
by default. This was not the case with earlier releases.
=head1 DESCRIPTION
+A class providing an object based interface to SysV IPC message queues.
+
=head1 METHODS
=over 4
=head1 DESCRIPTION
+A class providing an object based interface to SysV IPC semaphores.
+
=head1 METHODS
=over 4
defined in your system include files which are needed by the SysV
IPC calls.
-=over
+=over 4
=item ftok( PATH, ID )
$h{newkey} = newvalue;
print $h{oldkey};
...
-
+
untie %h;
-
+
=head1 DESCRIPTION
-
+
C<NDBM_File> establishes a connection between a Perl hash variable and
a file in NDBM_File format;. You can manipulate the data in the file
just as if it were in a Perl hash, but when your program exits, the
$h{newkey} = newvalue;
print $h{oldkey};
...
-
+
untie %h;
-
+
=head1 DESCRIPTION
-
+
C<ODBM_File> establishes a connection between a Perl hash variable and
a file in ODBM_File format;. You can manipulate the data in the file
just as if it were in a Perl hash, but when your program exits, the
In addition, some structure manipulation functions are available:
-=over
+=over 4
=item inet_aton HOSTNAME
Here is the hooking interface:
-=over
+=over 4
=item C<STORABLE_freeze> I<obj>, I<cloning>
Predicates are not exportable. They must be called by explicitely prefixing
them with the Storable package name.
-=over
+=over 4
=item C<Storable::last_op_in_netorder>
There are a few things you need to know however:
-=over
+=over 4
=item *
Syslog provides the functions:
-=over
+=over 4
=item openlog $ident, $logopt, $facility
$result = $t->eval;
$t->detach;
$flags = $t->flags;
-
+
if ($t->done) {
$t->join;
}
=head1 SEE ALSO
L<Thread>
-
+
=cut
sub new {
of attribute names. Notice that C<attrs::get> is not exported.
Valid attributes are as follows.
-=over
+=over 4
=item method
=head1 DESCRIPTION
+This module provides an encapsulation in Perl of the Java Native Interface.
+
=head1 Exported constants
JNI_ABORT
methods are documented that have proven useful over a longer time and
thus are unlikely to change.
-=over
+=over 4
=item CPAN::Author::as_glimpse()
Firewalls can be categorized into three basic types.
-=over
+=over 4
=item http firewall
There are two that I can think off.
-=over
+=over 4
=item SOCKS
=head1 FAQ
-=over
+=over 4
=item 1)
The accessor method provided by C<struct> for an element depends
on the declared type of the element.
-=over
+=over 4
=item Scalar (C<'$'> or C<'*$'>)
=head1 EXAMPLES
-=over
+=over 4
=item Example 1
Recognized options:
-=over
+=over 4
=item C<arrayDepth>, C<hashDepth>
=head2 Methods
-=over
+=over 4
=item dumpValue
=head1 FUNCTIONS
-=over
+=over 4
=item xsinit()
=head1 FUNCTIONS
-=over
+=over 4
=item new()
See ExtUtils::MM_Unix for a documentation of the methods provided there.
-=over
+=over 4
=item canonpath
unshift @MM::ISA, 'ExtUtils::MM_OS2';
+=pod
+
+=head1 NAME
+
+ExtUtils::MM_OS2 - methods to override UN*X behaviour in ExtUtils::MakeMaker
+
+=head1 SYNOPSIS
+
+ use ExtUtils::MM_OS2; # Done internally by ExtUtils::MakeMaker if needed
+
+=head1 DESCRIPTION
+
+See ExtUtils::MM_Unix for a documentation of the methods provided
+there. This package overrides the implementation of these methods, not
+the semantics.
+
+=head1 METHODS
+
+=over 4
+
+=cut
+
sub dlsyms {
my($self,%attribs) = @_;
}
1;
-__END__
-
-=head1 NAME
-
-ExtUtils::MM_OS2 - methods to override UN*X behaviour in ExtUtils::MakeMaker
-=head1 SYNOPSIS
-
- use ExtUtils::MM_OS2; # Done internally by ExtUtils::MakeMaker if needed
+__END__
-=head1 DESCRIPTION
+=pod
-See ExtUtils::MM_Unix for a documentation of the methods provided
-there. This package overrides the implementation of these methods, not
-the semantics.
+=back
+=cut
=head2 Methods always loaded
-=over
+=over 4
=item wraplist
of why this method overrides the MM_Unix method; see the ExtUtils::MM_Unix
documentation for more details.
-=over
+=over 4
=item guess_name (override)
there. This package overrides the implementation of these methods, not
the semantics.
-=over
+=over 4
=cut
All diagnostic output is sent to C<STDERR>.
-=over
+=over 4
=item C<Not in MANIFEST:> I<file>
It takes one argument, a list of key-value pairs, in which the following
keys are recognized:
-=over
+=over 4
=item DLBASE
=head1 FUNCTIONS
-=over
+=over 4
=item new()
$dir eq 'Doc_Root:[Help]'
$type eq '.Rnh'
-=over
+=over 4
=item C<basename>
there. This package overrides the implementation of these methods, not
the semantics.
-=over
+=over 4
=item eliminate_macros
=head2 Methods always loaded
-=over
+=over 4
=item canonpath (override)
there. This package overrides the implementation of these methods, not
the semantics.
-=over
+=over 4
=item devnull
Furthermore, for doing normal I/O you might need these:
-=over
+=over 4
=item $fh->print
Filter::Simple - Simplified source filtering
-
=head1 SYNOPSIS
# in MyFilter.pm:
C<use BANG;> statement (until the next C<no BANG;> statement, if any):
package BANG;
-
+
use Filter::Util::Call ;
sub import {
In other words, the previous example, would become:
package BANG;
-
+
use Filter::Simple sub {
s/BANG\s+BANG/die 'BANG' if \$BANG/g;
};
be made parametric:
package BANG;
-
+
use Filter::Simple sub {
my ($die_msg, $var_name) = @_;
s/BANG\s+BANG/die '$die_msg' if \${$var_name}/g;
The argument specification can be
-=over
+=over 4
=item !
The option requires an argument of the given type. Supported types
are:
-=over
+=over 4
=item s
=head1 SYNOPSIS
use Locale::Constants;
-
+
$codeset = LOCALE_CODE_ALPHA_2;
=head1 DESCRIPTION
=head1 SYNOPSIS
use Locale::Country;
-
+
$country = code2country('jp'); # $country gets 'Japan'
$code = country2code('Norway'); # $code gets 'no'
-
+
@codes = all_country_codes();
@names = all_country_names();
-
+
# add "uk" as a pseudo country code for United Kingdom
Locale::Country::_alias_code('uk' => 'gb');
code for United Kingdom, use the following:
use Locale::Country;
-
+
Locale::Country::_alias_code('uk' => 'gb');
With this code, both "uk" and "gb" are valid codes for United Kingdom,
country name:
$| = 1; # turn off buffering
-
+
print "Enter country code: ";
chop($code = <STDIN>);
$country = code2country($code, LOCALE_CODE_ALPHA_2);
=head1 SYNOPSIS
use Locale::Language;
-
+
$lang = code2language('en'); # $lang gets 'English'
$code = language2code('French'); # $code gets 'fr'
-
+
@codes = all_language_codes();
@names = all_language_names();
language name:
$| = 1; # turn off buffering
-
+
print "Enter language code: ";
chop($code = <STDIN>);
$lang = code2language($code);
This module has two interfaces, one through color() and colored() and the
other through constants.
-
+
color() takes any number of strings as arguments and considers them to be
space-separated lists of attributes. It then forms and returns the escape
sequence to set those attributes. It doesn't print it out, just returns
=head1 NAME
- Test - provides a simple framework for writing test scripts
+Test - provides a simple framework for writing test scripts
=head1 SYNOPSIS
=over 4
-=item B<1..M>
+=item B<'1..M'>
This header tells how many tests there will be. It should be the
first line output by your test program (but its okay if its preceded
$huge = 'overflow';
B<Example 3>
-
+
use Text::Wrap
$Text::Wrap::columns = 72;
are briefly defined below. See the L<perltie> section for more detailed
descriptive, as well as example code:
-=over
+=over 4
=item TIEARRAY classname, LIST
are summarized below. The L<perltie> section not only documents these, but
has sample code as well:
-=over
+=over 4
=item TIEHANDLE classname, LIST
package NewHash;
require Tie::Hash;
-
+
@ISA = (Tie::Hash);
-
+
sub DELETE { ... } # Provides needed method
sub CLEAR { ... } # Overrides inherited method
-
-
+
+
package NewStdHash;
require Tie::Hash;
-
+
@ISA = (Tie::StdHash);
-
+
# All methods provided by default, define only those needing overrides
sub DELETE { ... }
-
-
+
+
package main;
-
+
tie %new_hash, 'NewHash';
tie %new_std_hash, 'NewStdHash';
are briefly defined below. See the L<perltie> section for more detailed
descriptive, as well as example code:
-=over
+=over 4
=item TIEHASH classname, LIST
are summarized below. The L<perltie> section not only documents these, but
has sample code as well:
-=over
+=over 4
=item TIESCALAR classname, LIST
=head1 HISTORY
-=over
+=over 4
=item March 18th, 2000
Using C<autouse> will move important steps of your program's execution
from compile time to runtime. This can
-=over
+=over 4
=item *
Two types of mutators have different calling conventions:
-=over
+=over 4
=item C<++> and C<-->
Inheritance interacts with overloading in two ways.
-=over
+=over 4
=item Strings as values of C<use overload> directive
actual array, and the access hash. The tie()ing object for the access
hash is a reference to a reference to the actual array, so
-=over
+=over 4
=item *
}
This module is very unusual as overloaded modules go: it does not
-provide any usual overloaded operators, instead it provides the L<Last
-Resort> operator C<nomethod>. In this example the corresponding
+provide any usual overloaded operators, instead it provides the
+L<Last Resort> operator C<nomethod>. In this example the corresponding
subroutine returns an object which encapsulates operations done over
the objects: C<new symbolic 3> contains C<['n', 3]>, C<2 + new
symbolic 3> contains C<['+', 2, ['n', 3]]>.
tie %ea, 'OS2::ExtAttr', 'my.file';
print $ea{eaname};
$ea{myfield} = 'value';
-
+
untie %ea;
=head1 DESCRIPTION
my_type() returns the type of the current process (one of
"FS", "DOS", "VIO", "PM", "DETACH" and "UNKNOWN"), or C<undef> on error.
-=over
+=over 4
=item C<file_type(file)>
returns the type of the executable file C<file>, or
dies on error. The bits 0-2 of the result contain one of the values
-=over
+=over 4
=item C<T_NOTSPEC> (0)
The remaining bits should be masked with the following values to
determine the type of the executable:
-=over
+=over 4
=item C<T_BOUND> (8)
returns a list of the following data:
-=over
+=over 4
-=item
+=item *
Title of the process (in the C<Ctrl-Esc> list);
-=item
+=item *
window handle of switch entry of the process (in the C<Ctrl-Esc> list);
-=item
+=item *
window handle of the icon of the process;
-=item
+=item *
process handle of the owner of the entry in C<Ctrl-Esc> list;
-=item
+=item *
process id of the owner of the entry in C<Ctrl-Esc> list;
-=item
+=item *
session id of the owner of the entry in C<Ctrl-Esc> list;
-=item
+=item *
whether visible in C<Ctrl-Esc> list;
-=item
+=item *
whether item cannot be switched to (note that it is not actually
grayed in the C<Ctrl-Esc> list));
-=item
+=item *
whether participates in jump sequence;
-=item
+=item *
program type. Possible values are:
session. Likewise, if it's a full-screen WIN-OS/2 program, it runs in
a PROG_VDM session.
-
=back
=item C<set_title(newtitle)>