[19682] in Perl-Users-Digest
Perl-Users Digest, Issue: 1877 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 5 11:05:33 2001
Date: Fri, 5 Oct 2001 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1002294308-v10-i1877@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 5 Oct 2001 Volume: 10 Number: 1877
Today's topics:
Re: 2nd request pls-Embed sound to cgi? <Thomas@Baetzler.de>
Re: 2nd request pls-Embed sound to cgi? <Thomas@Baetzler.de>
Re: 2nd request pls-Embed sound to cgi? <melorama@nospam.gov>
[ANNOUNCE] Aspect 0.04 <marcel.gruenauer@chello.at>
ANNOUNCE: DBD::Chart 0.42 available <darnold@earthlink.net>
ANNOUNCE: Getopt::Long 2.26_01 (Johan Vromans)
ANNOUNCE: Net::Netmask version 1.9001 (David Muir Sharnoff)
ANNOUNCE: New release of Text::Wrap - 2001.0929 (David Muir Sharnoff)
ANNOUNCE: Printer-0.93 (Stephen Patterson)
Re: CGI form email oddness - not acting as expected <joe+usenet@sunstarsys.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 05 Oct 2001 15:48:41 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: 2nd request pls-Embed sound to cgi?
Message-Id: <v4errt0n0r2fema1ltik3376t77kvsoaqs@4ax.com>
On Thu, 04 Oct 2001, Mel Matsuoka <melorama@nospam.gov> wrote:
>On Thu, 04 Oct 2001 20:48:28 +0200, Thomas Bätzler <thomas@baetzler.de> wrote:
>>If you answered B, then the answer is that the CGI must send you a web
>>page that contains an active element to play the sound - i.e. some
>>JavaScript code - whenever somebody logs in. However, per definition,
>>the server can't just alert you in real-time - instead, you have to
>>make certain that the page reloads sufficiently often for your needs.
>
>Well, it would be very trivial to make the script send an email or other
>instant-messaging protocol to the OP's local machine, which could trigger a beep
>or visual notification or something even more creative. There are a number of
>instant messaging modules on CPAN that the OP could check out.
Email does not have guaranteed delivery time. IM messages may or may not
be allowed through a local firewall, so that's not a good solution.
>I personally like the idea of charging programming customers by the number of
>characters in the final code. I can throw in warnings for free, and hopefully
>I'll end up writing more code...yeah, thats the ticket ;)
But then you're penalizing yourself for writing nice, concise programs.
In any case, what I meant was that if I have to force me to work through
somebody's broken code, then I expect to be paid exceptionally well :-)
Ciao,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Fri, 05 Oct 2001 15:51:01 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: 2nd request pls-Embed sound to cgi?
Message-Id: <hjerrts3s183dep7i4lebf3slve6btco7m@4ax.com>
On 5 Oct 2001 07:17:10 GMT, abigail@foad.org (Abigail) wrote:
[...]
>I fail to see the Perl problems with that, you'd just use "print".
[...]
I guess the problem is not making the chalk mark, it's to know where to
make it.
Of course you're right,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Fri, 05 Oct 2001 14:59:03 GMT
From: Mel Matsuoka <melorama@nospam.gov>
Subject: Re: 2nd request pls-Embed sound to cgi?
Message-Id: <eogrrt0i1cs4jt1l66bnbma8nof8f1r7vk@4ax.com>
On Fri, 05 Oct 2001 15:48:41 +0200, Thomas Bätzler <Thomas@Baetzler.de> wrote:
>On Thu, 04 Oct 2001, Mel Matsuoka <melorama@nospam.gov> wrote:
>
>>On Thu, 04 Oct 2001 20:48:28 +0200, Thomas Bätzler <thomas@baetzler.de> wrote:
>>>If you answered B, then the answer is that the CGI must send you a web
>>>page that contains an active element to play the sound - i.e. some
>>>JavaScript code - whenever somebody logs in. However, per definition,
>>>the server can't just alert you in real-time - instead, you have to
>>>make certain that the page reloads sufficiently often for your needs.
>>
>>Well, it would be very trivial to make the script send an email or other
>>instant-messaging protocol to the OP's local machine, which could trigger a beep
>>or visual notification or something even more creative. There are a number of
>>instant messaging modules on CPAN that the OP could check out.
>
>Email does not have guaranteed delivery time. IM messages may or may not
>be allowed through a local firewall, so that's not a good solution.
You would be correct if the OP was sitting behind a local firewall. But he made
no mention of such a fact, and even if he /was/ behind a firewall, it is
perfectly possible to have the firewall configured to allow IM service traffic
through.
This isn't like trying to validate e-mail addresses submitted from an HTML
form...in this case, just because there are ways the IM solution could
conceivably be defeated, it does not necessarily mean it's "not a good
solution." Placed in the stated context of what the poster said he wanted to
do, the IM solution is probably the most elegant and simplest solution given so
far. It may not be bulletproof, but it certainly works a lot more effectively
than an auto-reloading HTML document.
>>I personally like the idea of charging programming customers by the number of
>>characters in the final code. I can throw in warnings for free, and hopefully
>>I'll end up writing more code...yeah, thats the ticket ;)
>
>But then you're penalizing yourself for writing nice, concise programs.
>In any case, what I meant was that if I have to force me to work through
>somebody's broken code, then I expect to be paid exceptionally well :-)
Sir, I knew exactly what you meant...I was being facetious. ;)
Aloha,
mel
------------------------------
Date: 3 Oct 2001 09:24:04 GMT
From: Marcel Grunauer <marcel.gruenauer@chello.at>
Subject: [ANNOUNCE] Aspect 0.04
Message-Id: <trrhe1t009o466@corp.supernews.com>
NAME
Aspect-Oriented Perl - Aspect-oriented programming in pure Perl
DESCRIPTION
Introduction to AOP
Aspect-oriented Programming (AOP) is a programming methodology developed
by Xerox PARC. The basic idea is that in complex class systems there are
certain aspects or behaviors that cannot normally be expressed in a
coherent, concise and precise way. One example of such aspects are
design patterns, which combine various kinds of classes to produce a
common type of behavior.
Aspects in Perl provide:
* Dynamic enabling and disabling of aspects at run-time
* Modular aspects for prepackaged functionality
See `Aspect::Intro' for an introduction to aspect-oriented programming.
See `Aspect::Overview' for an overview of the modules and classes that
comprise this distribution. See `Aspect::Ideas' for ideas on future
developments. See `Aspect::Cookbook' for aspect-oriented recipes for
common situations. See the individual modules' manpages for information
on how to use and implement aspects.
LIMITATIONS
* Many types of join points and pointcuts remain unimplemented.
* Performance may suffer for aspects affecting a wide range of join
points.
PREREQUISITES
`Aspect' requires the following modules, which can be obtained from
CPAN:
Class::MethodMaker
Hook::LexWrap
IO::Scalar
If you install `Aspect' from the CPAN shell, these modules will, if
necessary, be installed automatically as well.
INSTALLATION
It's all pure Perl, so just put the .pm files in their appropriate local
Perl subdirectories.
The easiest way to install this distribution is using the standard build
process for Perl modules:
perl Makefile.PL
make
make test
make install
Or you could use the CPAN shell, as described in the `CPAN' module
documentation.
CHANGES AND FUTURE DEVELOPMENT
This `README' refers to version 0.04. For details of changes, refer to
the file `Changes'.
Future versions will provide new types of join points, pointcuts and
modular aspects. Stability and performance is also an ongoing concern.
See `Aspect::Ideas' for an overview of these ideas.
CHANGES IN VERSION 0.04
* Added documentation
AVAILABILITY
`Aspect' has been uploaded to the CPAN; in any case it is available
from:
http://codewerk.unixbeard.net/aspects/Aspect-0.04.tar.gz
AUTHOR
Marcel Grunauer, <marcel@codewerk.com>
COPYRIGHT
Copyright 2001 Marcel Grunauer. All rights reserved.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
SEE ALSO
Aspect::Intro(3pm), Aspect::Cookbook(3pm), Aspect::Ideas(3pm),
Aspect(3pm).
Marcel
--
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
-- London.pm strategy aka "embrace and extend" aka "mark and sweep"
------------------------------
Date: Mon, 01 Oct 2001 17:34:53 GMT
From: "Dean Arnold" <darnold@earthlink.net>
Subject: ANNOUNCE: DBD::Chart 0.42 available
Message-Id: <trrhe9mt3qe66d@corp.supernews.com>
DBD::Chart 0.42 is now available from either
http://www.presicient.com/dbdchart/ or from CPAN (shortly).
Changes from 0.41:
- fix to support 'X-ORIENT=HORIZONTAL' on candlestick charts
and symbolic domains
FYI: DBD::Chart is a Perl DBI driver abstraction for rendering charts
and graphs using a variant of SQL. Review the DBD::Chart homepage at
http://www.presicient.com/dbdchart/ for detailed
information.
Regards,
Dean Arnold
------------------------------
Date: Fri, 05 Oct 2001 14:39:25 -0000
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: ANNOUNCE: Getopt::Long 2.26_01
Message-Id: <trrhgttnbp24a5@corp.supernews.com>
Version 2.26_01 of module Getopt::Long has been released to CPAN.
It is a prerelease of version 2.27.
Module Getopt::Long implements an extended getopt function called
GetOptions(). This function implements the POSIX standard for command
line options, with GNU extensions, while still capable of handling
the traditional one-letter options (including option bundling).
It adds a lot of features like automatic abbreviation of option names,
aliases and callback functions.
The README document is attached to this message.
The easiest way to get it is by using the CPAN shell:
perl -MCPAN -e 'install("JV/Getopt-Long-2.26_01.tar.gz")'
Alternatively, use a Web browser and point it to the CPAN search engine:
http://search.cpan.org/search?module=Getopt::Long
Changes in this version
-----------------------
* Fix several problems with internal and external use of 'die' and
signal handlers.
* A callback routine that is associated with a hash-valued option will
now have both the hask key and the value passed. It used to get only
the value passed.
* Eliminated the use of autoloading. Autoloading kept generating
problems during development, and when using perlcc.
* Redesigned the regression tests.
See file CHANGES
Previous released version was 2.26.
---- README ----
Module Getopt::Long - extended processing of command line options
=================================================================
Module Getopt::Long implements an extended getopt function called
GetOptions(). This function implements the POSIX standard for command
line options, with GNU extensions, while still capable of handling
the traditional one-letter options.
In general, this means that command line options can have long names
instead of single letters, and are introduced with a double dash `--'.
Optionally, Getopt::Long can support the traditional bundling of
single-letter command line options.
Getopt::Long::GetOptions() is part of the Perl 5 distribution. It is
the successor of newgetopt.pl that came with Perl 4. It is fully
upward compatible. In fact, the Perl 5 version of newgetopt.pl is just
a wrapper around the module.
For complete documentation, see the Getopt::Long POD document or use
the command
perldoc Getopt::Long
FEATURES
========
* Long option names
Major advantage of using long option names is that it is much easier
to memorize the option names. Using single-letter names one quickly
runs into the problem that there is no logical relationship between
the semantics of the selected option and its option letter.
Disadvantage is that it requires more typing. Getopt::Long provides
for option name abbreviation, so option names may be abbreviated to
uniqueness. Also, modern shells like Cornell's tcsh support option
name completion. As a rule of thumb, you can use abbreviations freely
while running commands interactively but always use the full names in
scripts.
Examples (POSIX):
--long --width=80 --height=24
Extensions:
-long (convenience) +width=80 (deprecated) -height 24 (traditional)
By default, long option names are case insensitive.
* Single-letter options and bundling
When single-letter options are requested, Getopt::Long allows the
option names to be bundled, e.g. "-abc" is equivalent to "-a -b -c".
In this case, long option names must be introduced with the POSIX "--"
introducer.
Examples:
-lgAd (bundle) -xw 80 (bundle, w takes a value) -xw80 (same)
even -l24w80 (l = 24 and w = 80)
By default, single-letter option names are case sensitive.
* Flexibility:
- options can have alternative names, using an alternative name
will behave as if the primary name was used;
- options can be negatable, e.g. "debug" will switch it on, while
"nodebug" will switch it off.
- options can set values, but also add values producing an array
of values instead of a single scalar value, or set values in a hash.
* Options linkage
Using Getopt::Long gives the programmer ultimate control over the
command line options and how they must be handled:
- by setting a global variable in the calling program;
- by setting a specified variable;
- by entering the option name and the value in an associative array
(hash) or object (if it is a blessed hash);
- by calling a user-specified subroutine with the option name and
the value as arguments (for hash options: the name, key and value);
- combinations of the above.
* Customization:
The module can be customized by specifying settings in the 'use'
directive, or by calling a special method, Getopt::Long::Configure.
For example, the following two cases are functionally equal:
use Getopt::Long qw(:config bundling no_ignore_case);
and
use Getopt::Long;
Getopt::Long::Configure qw(bundling no_ignore_case);
Some of the possible customizations. Most of them take a "no_" prefix
to reverse the effect:
- default
Restore default settings.
- auto_abbrev
Allow option names to be abbreviated to uniqueness.
- getopt_compat
Allow '+' to start options.
- gnu_compat
Compatibility with GNU getopt_long().
- permute
- require_order
Whether non-options are allowed to be mixed with options.
permute means that
-foo arg1 -bar arg2 arg3
is equivalent to
-foo -bar arg1 arg2 arg3
(provided -foo does not take an argument value).
require_order means that options processing
terminates when the first non-option is encountered.
-foo arg1 -bar arg2 arg3
is equivalent to
-foo -- arg1 -bar arg2 arg3
- bundling
Setting this variable to a non-zero value will allow
single-character options to be bundled. To distinguish bundles
from long option names, long options must be introduced with
"--" and single-character options (and bundles) with "-".
- ignore_case
Ignore case when matching options.
- pass_through
Do not issue error messages for unknown options, but leave
them (pass-through) in @ARGV.
- prefix
The string that starts options. See also prefix_pattern.
- prefix_pattern
A Perl pattern that identifies the strings that introduce
options. Default is (--|-|\+) unless environment variable
POSIXLY_CORRECT has been set, in which case it is (--|-).
- debug
Enable copious debugging output.
* Object oriented interface:
Using the object oriented interface, multiple parser objects can be
instantiated, each having their own configuration settings:
$p1 = new Getopt::Long::Parser (config => ["posix"]);
$p2 = new Getopt::Long::Parser (config => ["no_posix"]);
if ($p1->getoptions(...options descriptions...)) ...
AVAILABILITY
============
The official version for module Getopt::Long comes with the Perl 5
distribution.
Newer versions will be made available on the Comprehensive Perl Archive
Network (CPAN), see "http://www.perl.com/CPAN/authors/Johan_Vromans".
Or use the CPAN search engine:
http://search.cpan.org/search?mode=module&query=Getopt::Long
http://search.cpan.org/search?module=Getopt::Long
COPYRIGHT AND DISCLAIMER
========================
Module Getopt::Long is Copyright 2001,1990 by Johan Vromans.
This program is free software; you can redistribute it and/or
modify it under the terms of the Perl Artistic License or the
GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any
later version.
-------------------------------------------------------------------
Johan Vromans jvromans@squirrel.nl
Squirrel Consultancy Haarlem, the Netherlands
http://www.squirrel.nl http://www.squirrel.nl/people/jvromans
------------------ "Arms are made for hugging" --------------------
------------------------------
Date: 30 Sep 2001 01:10:26 -0700
From: muir@idiom.com (David Muir Sharnoff)
Subject: ANNOUNCE: Net::Netmask version 1.9001
Message-Id: <trrheglbt1d74@corp.supernews.com>
You can find this in CPAN at
http://www.cpan.org/authors/id/MUIR/modules/Net-Netmask-1.9001.tar.gz
or (until CPAN picks it up) at
ftp:://ftp.idiom.com/users/muir/CPAN/modules/Net-Netmask-1.9001.tar.gz
-Dave
...CHANGELOG...................................................
Sapient Fridge <sapient.fridge@WaCkY.zzn.com> and Alexander Karptsov
<karp@visti.net> sent a patch for a bug in range2cidrlist. The
last IP in the range was skipped.
Sam Denton <sdenton@wantec.com> requested support for
a.b.c.d/mask.mask.mask.mask.
Sam Denton <sdenton@wantec.com> sent a request that I include the
world's fastest sort-by-ip-address-in-perl function in Net::Netmask
as there didn't seem to be a better place to put it. I've included
it. The function in question was found/benchmarked by John Porter
and written about in the Perl-Users Digest, Issue 3860, Volume 8.
My IP address are now 216.240.32/19 instead of 140.174.82/19 and
thus I've changed the examples in the pod. :-)
...POD.........................................................
NAME
Net::Netmask - parse, manipulate and lookup IP network blocks
SYNOPSIS
use Net::Netmask;
$block = new Net::Netmask (network block)
$block = new Net::Netmask (network block, netmask)
$block = new2 Net::Netmask (network block)
$block = new2 Net::Netmask (network block, netmask)
print $block->desc() # a.b.c.d/bits
print $block->base()
print $block->mask()
print $block->hostmask()
print $block->bits()
print $block->size()
print $block->maxblock()
print $block->broadcast()
print $block->next()
print $block->match($ip);
print $block->nth(1, [$bitstep]);
for $ip ($block->enumerate([$bitstep])) { }
for $zone ($block->inaddr()) { }
my $table = {};
$block->storeNetblock([$table])
$block->deleteNetblock([$table])
$block = findNetblock(ip, [$table])
$block = findOuterNetblock(ip, [$table])
@blocks = findAllNetblock(ip, [$table])
@blocks = range2cidrlist($beginip, $endip);
@listofblocks = cidrs2contiglists(@blocks);
@sorted_ip_addrs = sort_by_ip_address(@unsorted_ip_addrs)
DESCRIPTION
Net::Netmask parses and understands IPv4 CIDR blocks. It's built with an object-
oriented interface. Nearly all functions are methods that operate on a Net::Netmask
object.
There are methods that provide the nearly all bits of information about a network
block that you might want.
There are also functions to put a network block into a table and then later lookup
network blocks by IP address in that table. There are functions to turn a IP address
range into a list of CIDR blocks. There are functions to turn a list of CIDR blocks
into a list of IP addresses.
There is a function for sorting by text IP address.
CONSTRUCTING
Net::Netmask objects are created with an IP address and optionally a mask. There are
many forms that are recognized:
'216.240.32.0/24' The preferred form.
'216.240.32.0:255.255.255.0'
'216.240.32.0-255.255.255.0'
'216.240.32.0', '255.255.255.0'
'216.240.32.0', '0xffffff00'
'216.240.32.0 - 216.240.32.255'
'216.240.32.4' A /32 block.
'216.240.32' Always a /24 block.
'216.240' Always a /16 block.
'140' Always a /8 block.
'216.240.32/24'
'216.240/16'
'default' 0.0.0.0/0 (the default route)
There are two constructor methods: `new' and `new2'. The difference is that `new2'
will return undef for invalid netmasks and `new' will return a netmask object even if
the constructor could not figure out what the network block should be.
With `new', the error string can be found as $block->{'ERROR'}. With `new2' the error
can be found as Net::Netmask::errstr or $Net::Netmask::error.
METHODS
base() Returns base address of the network block as a string. Eg:
216.240.32.0. Base does not give an indication of the size of
the network block.
mask() Returns the netmask as a string. Eg: 255.255.255.0.
hostmask() Returns the host mask which is the oposite of the netmask. Eg:
0.0.0.255.
bits() Returns the netmask as a number of bits in the network portion of
the address for this block. Eg: 24.
size() Returns the number of IP addresses in a block. Eg: 256.
broadcast() The blocks broadcast address. (The last IP address inside the
block.) Eg: 192.168.1.0/24 => 192.168.1.255
next() The first IP address following the block. (The IP address
following the broadcase address.) Eg: 192.168.1.0/24 =>
192.168.2.0
match($ip) Returns a true if the IP number $ip matches the given network.
That is, a true value is returned if $ip is between base()
amd broadcast(). For example, if we have the network
192.168.1.0/24, then
192.168.0.255 => 0
192.168.1.0 => "0 "
192.168.1.1 => 1
...
192.168.1.255 => 255
$ip should be a dotted-quad (eg: "192.168.66.3")
It just happens that the return value is the position within
the block. Since zero is a legal position, the true string "0
" is returned in it's place. "0 " is numerically zero though.
When wanting to know the position inside the block, a good
idiom is:
$pos = $block->match($ip) || die;
$pos += 0;
maxblock() Much of the time, it is not possible to determine the size of a
network block just from it's base address. For example, with
the network block '216.240.32.0/27', if you only had the
'216.240.32.0' portion you wouldn't be able to tell for
certain the size of the block. '216.240.32.0' could be
anything from a '/23' to a '/32'. The maxblock() method gives
the size of the larges block that the current block's address
would allow it to be. The size is given in bits. Eg: 23.
enumerate([$bitstep) Returns a list of all the IP addresses in the block. Be very
careful not to use this function of large blocks. The IP
addresses are returned as strings. Eg: '216.240.32.0',
'216.240.32.1', ... '216.240.32.255'.
If the optional argument is given, step through the block in
increments of a given network size. To step by 4, use a
bitstep of 30 (as in a /30 network).
nth($index, [$bitstep]) Returns the nth element of the array that enumerate would return
if it were called. So, to get the first usable address in a
block, use nth(1). To get the broadcast address, use nth(-1).
To get the last usable adress, use nth(-2).
inaddr() Returns an inline list of tuples. There is a tuple for each DNS
zone name in the block. If the block is smaller than a /24,
then the zone of the enclosing /24 is returned.
Each tuple contains: the DNS zone name, the last component of
the first IP address in the block in that zone, the last
component of the last IP address in the block in that zone.
Examples: the list returned for the block '216.240.32.0/23'
would be: '82.174.140.in-addr.arpa', 0, 255, '83.174.140.in-
addr.arpa', 0, 255. The list returned for the block
'216.240.32.64/27' would be: '82.174.140.in-addr.arpa', 64,
95.
storeNetblock([$t]) Adds the current block to an table of network blocks. The table
can be used to query which network block a given IP address
is in.
The optional argument allows there to be more than one table.
By default, an internal table is used. If more than one table
is needed, then supply a reference to a HASH to store the
data in.
deleteNetblock([$t]) Deletes the current block from a table of network blocks.
The optional argument allows there to be more than one table.
By default, an internal table is used. If more than one table
is needed, then supply a reference to a HASH to store the
data in.
FUNCTIONS
sort_by_ip_address This function is included in `Net::Netmask' simply because there
doesn't seem to be a better place to put it on CPAN. It turns
out that there is one method for sorting dotted-quads
("a.b.c.d") that is faster than all the rest. This is that
way. Use it as `sort_by_ip_address(@list_of_ips)'.
findNetblock(ip, [$t]) Search the table of network blocks (created with storeNetBlock)
to find if any of them contain the given IP address. The IP
address is expected to be a string. If more than one block in
the table contains the IP address, the smallest network block
will be the one returned.
The return value is either a Net::Netmask object or undef.
findOuterNetblock(ip, [$t])
Search the table of network blocks (created with
storeNetBlock) to find if any of them contain the given IP
address. The IP address is expected to be a string. If more
than one block in the table contains the IP address, the
largest network block will be the one returned.
The return value is either a Net::Netmask object or undef.
findAllNetblock(ip, [$t])
Search the table of network blocks (created with
storeNetBlock) to find if any of them contain the given IP
address. The IP address is expected to be a string. All
network blocks in the table that contain the IP address will
be returned.
The return value is a list of Net::Netmask objects.
range2cidrlist($startip, $endip)
Given a range of IP addresses, return a list of blocks that
span that range.
For example, range2cidrlist('216.240.32.128',
'216.240.36.127'), will return a list of Net::Netmask objects
that corrospond to:
216.240.32.128/25
216.240.33.0/24
216.240.34.0/23
216.240.36.0/25
cidrs2contiglists(@listOfBlocks)
`cidrs2contiglists' will rearange a list of Net::Netmask
objects such that contigueous sets are in sublists and each
sublist is discontigeous with the next.
For example, given a list of Net::Netmask objects
corrosponding to the following blocks:
216.240.32.128/25
216.240.33.0/24
216.240.36.0/25
`cidrs2contiglists' will return a list with two sublists:
216.240.32.128/25 216.240.33.0/24
216.240.36.0/25
The behavior for overlapping blocks is not currently defined.
COPYRIGHT
Copyright (C) 1998, 2001 David Muir Sharnoff. All rights reserved. License hereby
granted for anyone to use this module at their own risk. Please feed useful changes
back to muir@idiom.com.
--
--
Notice: Your mouse has been moved. Windows will now restart so this
change can take effect.
------------------------------
Date: 30 Sep 2001 00:16:53 -0700
From: muir@idiom.com (David Muir Sharnoff)
Subject: ANNOUNCE: New release of Text::Wrap - 2001.0929
Message-Id: <trrhevhijmpd80@corp.supernews.com>
You can find this in CPAN at
http://www.cpan.org/authors/id/MUIR/modules/Text-Tabs+Wrap-2001.0929.tar.gz
or (until CPAN picks it up) at
ftp:://ftp.idiom.com/users/muir/CPAN/modules/Text-Tabs+Wrap-2001.0929.tar.gz
This module is part of the perl distribution and these changes
will (presumably) be picked up and redistributed with future
releases.
-Dave
...CHANGELOG...................................................
Philip Newton <Philip.Newton@gmx.net> sent in a clean patch that
added support for defining words differently; that prevents
Text::Wrap from untainting strings; and that fixes a documentation
bug.
So that fill.t can be used in the version included in the perl
distribution, fill.t no longer uses File::Slurp.
Both Sweth Chandramouli <svc@sweth.net> and Drew Degentesh
<ddegentesh@daed.com> both objected to the automatic unexpand
that Text::Wrap does on its results. Drew sent a patch which
has been integrated.
Way back in '97, Joel Earl <jrearl@VNET.IBM.COM> asked that
it be possible to use a line separator other than \n when
adding new lines. There is now support for that.
...POD...Text::Wrap............................................
NAME
Text::Wrap - line wrapping to form simple paragraphs
SYNOPSIS
Example 1
use Text::Wrap
$initial_tab = "\t"; # Tab before first line
$subsequent_tab = ""; # All other lines flush left
print wrap($initial_tab, $subsequent_tab, @text);
print fill($initial_tab, $subsequent_tab, @text);
@lines = wrap($initial_tab, $subsequent_tab, @text);
@paragraphs = fill($initial_tab, $subsequent_tab, @text);
Example 2
use Text::Wrap qw(wrap $columns $huge);
$columns = 132; # Wrap at 132 characters
$huge = 'die';
$huge = 'wrap';
$huge = 'overflow';
Example 3 use Text::Wrap
$Text::Wrap::columns = 72;
print wrap('', '', @text);
DESCRIPTION
`Text::Wrap::wrap()' is a very simple paragraph formatter. It formats a single
paragraph at a time by breaking lines at word boundries. Indentation is controlled for
the first line (`$initial_tab') and all subsquent lines (`$subsequent_tab')
independently. Please note: `$initial_tab' and `$subsequent_tab' are the literal
strings that will be used: it is unlikley you would want to pass in a number.
Text::Wrap::fill() is a simple multi-paragraph formatter. It formats each paragraph
separately and then joins them together when it's done. It will destory any whitespace
in the original text. It breaks text into paragraphs by looking for whitespace after a
newline. In other respects it acts like wrap().
OVERRIDES
`Text::Wrap::wrap()' has a number of variables that control its behavior. Because
other modules might be using `Text::Wrap::wrap()' it is suggested that you leave these
variables alone! If you can't do that, then use `local($Text::Wrap::VARIABLE) =
YOURVALUE' when you change the values so that the original value is restored. This
`local()' trick will not work if you import the variable into your own namespace.
Lines are wrapped at `$Text::Wrap::columns' columns. `$Text::Wrap::columns' should be
set to the full width of your output device. In fact, every resulting line will have
length of no more than `$columns - 1'.
It is possible to control which characters terminate words by modifying
`$Text::Wrap::break'. Set this to a string such as `'[\s:]'' (to break before spaces
or colons) or a pre-compiled regexp such as `qr/[\s']/' (to break before spaces or
apostrophes). The default is simply `'\s''; that is, words are terminated by spaces.
(This means, among other things, that trailing punctuation such as full stops or
commas stay with the word they are "attached" to.)
Beginner note: In example 2, above `$columns' is imported into the local namespace,
and set locally. In example 3, `$Text::Wrap::columns' is set in its own namespace
without importing it.
`Text::Wrap::wrap()' starts its work by expanding all the tabs in its input into
spaces. The last thing it does it to turn spaces back into tabs. If you do not want
tabs in your results, set `$Text::Wrap::unexapand' to a false value. Likewise if you
do not want to use 8-character tabstops, set `$Text::Wrap::tabstop' to the number of
characters you do want for your tabstops.
If you want to separate your lines with something other than `\n' then set
`$Text::Wrap::seporator' to your preference.
When words that are longer than `$columns' are encountered, they are broken up.
`wrap()' adds a `"\n"' at column `$columns'. This behavior can be overridden by
setting `$huge' to 'die' or to 'overflow'. When set to 'die', large words will cause
`die()' to be called. When set to 'overflow', large words will be left intact.
Historical notes: 'die' used to be the default value of `$huge'. Now, 'wrap' is the
default value.
EXAMPLE
print wrap("\t","","This is a bit of text that forms
a normal book-style paragraph");
AUTHOR
David Muir Sharnoff <muir@idiom.com> with help from Tim Pierce and many many others.
...POD...Text::Tabs............................................
NAME
Text::Tabs -- expand and unexpand tabs per the unix expand(1) and unexpand(1)
SYNOPSIS
use Text::Tabs;
$tabstop = 4; @lines_without_tabs = expand(@lines_with_tabs); @lines_with_tabs =
unexpand(@lines_without_tabs);
DESCRIPTION
Text::Tabs does about what the unix utilities expand(1) and unexpand(1) do. Given a
line with tabs in it, expand will replace the tabs with the appropriate number of
spaces. Given a line with or without tabs in it, unexpand will add tabs when it can
save bytes by doing so. Invisible compression with plain ascii!
BUGS
expand doesn't handle newlines very quickly -- do not feed it an entire document in
one string. Instead feed it an array of lines.
AUTHOR
David Muir Sharnoff <muir@idiom.com>
--
--
Notice: Your mouse has been moved. Windows will now restart so this
change can take effect.
------------------------------
Date: 5 Oct 2001 04:22:45 -0700
From: s.patterson@freeuk.com (Stephen Patterson)
Subject: ANNOUNCE: Printer-0.93
Message-Id: <trrhdjlf8l6a5c@corp.supernews.com>
NAME
Printer.pm - a low-level, platform independent printing interface
(curently Linux and MS Win32. other UNIXES should also work.)
This version includes working support for Windows 95.
SYNOPSIS
use Printer;
$prn = new Printer('linux' => 'lp',
'MSWin32' => 'LPT1',
$OSNAME => 'Printer');
@available_printers = $prn->list_printers;
$prn->use_default;
$prn->print($data);
DESCRIPTION
A low-level cross-platform interface to system printers.
This module is intended to allow perl programs to use and query printers
on any computer system capable of running perl. The intention of this
module is for a program to be able to use the printer without having to
know which operating system is being used.
PLATFORMS
This code has been tested on Linux, windows 95 and windows NT4.
I've added possible UNIX support, using the Linux routines. This assumes
that your print command is lpr, your queue list command is lpq and that
your printer names can be found by grepping /etc/printcap. If it's
anything different, email me with the value of "$OSNAME" or "$^O" and
the corrections.
USAGE
Open a printer handle
$printer = new Printer('osname' => 'printer port');
$printer = new Printer('MSWin32' => 'LPT1',
'Linux' => 'lp');
This method takes a hash to set the printer name to be used for each
operating system that this module is to be used on (the hash keys are
the values of $^O or $OSNAME for each platform) and returns a printer
handle which is used by the other methods.
This method dies with an error message on unsupported platforms.
Select the default printer
$printer->use_default;
Linux
The default printer is read from the environment variables $PRINTER,
$LPDEST, $NPRINTER, $NGPRINTER in that order, or is set to "lp" if these
variables are not defined. You will be warned if this happens.
Win32
THe default printer is read from the registry (trust me, this works).
List available printers
%hash = $printer->list_printers.
This returns a hash of arrays listing all available printers. The hash
keys are:
* "%hash{names}" - printer names
* "%hash{ports}" - printer ports
Print
$printer->print($data);
Print a scalar value onto the print server through a pipe (like Linux)
List queued jobs
@jobs = $printer->list_jobs;
Linux
Each cell of the array returned is an entire line from the system's lpq
command.
Windows
The array returned is empty (for compatibility).
Warning
This method will probably return a hash in future when I've figured out
how to access the print queue on windows.
BUGS
list_queue needs writing for win32
AUTHOR
Stephen Patterson <s.patterson@freeuk.com>
TODO
Make list_queue work on windows.
Test and fully port to UNIX.
Port to MacOS.
Changelog
0.93
* Printing on windows 95 now uses a unique spoolfile which will not
overwrite an existing file.
* Documentation spruced up to look like a normal linux manpage.
0.92
* Carp based error tracking introduced.
0.91
* Use the linux routines for all UNIXES.
0.9
Initial release version
------------------------------
Date: 05 Oct 2001 09:41:41 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: CGI form email oddness - not acting as expected
Message-Id: <m3n136i4q2.fsf@mumonkan.sunstarsys.com>
jennlee.2@eudoramail.com (Jennifer) writes:
> Regarding bypassing a local MSA and connecting directly to a mail
> server, I'm not sure I understand what you mean. I know I'm going to
> sound pretty ignorant but what does MSA stand for? I did some
> searching on the net and couldn't find anything that looked right.
<OT>
MSA = message submission agent; I'd guess that your OS already has a
decent one. Although the requirements are minimal, I doubt sendmail.pl
meets them.
See google( MSA RFC ) for more details.
</OT>
> I would love to use SendMail but currently our webmaster will not
> install any modules, so I'm mostly stuck with what actually came
> installed on the web server. Reinventing the wheel is always fun ;-)
% perldoc -q "module from CPAN"
HTH
--
Joe Schaefer "Familiarity breeds contempt -- and children."
--Mark Twain
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 1877
***************************************