[7946] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1571 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 2 20:07:42 1998

Date: Fri, 2 Jan 98 17:01:32 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 2 Jan 1998     Volume: 8 Number: 1571

Today's topics:
     ANNOUNCE: SNMP-1.7 <gmarzot@BayNetworks.COM>
     ANNOUNCE: sybperl 2.09 <mpeppler@mbay.net>
     ANNOUNCE: Tie::Registry beta, new Win32API::Registry (Tye McQueen)
     ANNOUNCE: VMS::Persona 1.00 (Dan Sugalski)
     Camel book v. Win32 (Mark Folse)
     Re: Convert GET to POST (brian d foy)
     Re: Convert GET to POST <merlyn@stonehenge.com>
     Re: Convert GET to POST <rootbeer@teleport.com>
     Re: Help on writing perl. (Mike Stok)
     Re: Help on writing perl. <rootbeer@teleport.com>
     Re: Help with calculating Gunning (reading level) index (Josh Kortbein)
     Re: Help!: Sample HTTP POST request needed. (brian d foy)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 2 Jan 1998 23:51:17 GMT
From: Joe Marzot <gmarzot@BayNetworks.COM>
Subject: ANNOUNCE: SNMP-1.7
Message-Id: <68juhl$bg3$1@news1.teleport.com>


attached is the README from the latest release of the perl5 SNMP
extension module.

ftp:/ftp.corpeast.baynetworks.com/netman/snmp/perl5/SNMP-1.7.tar.gz

-GSM


------
		     Perl5 SNMP Extension Module
		       for the UCD SNMP Library
		G.S. Marzot (gmarzot@baynetworks.com)

Contents:
   Introduction:
   Availability:
   Supported Platforms:
   Installation:
   Operational Description:
   Trouble Shooting:
   Acknowledments:
   History:


Introduction:

This is a Perl5 extension module which provides an interface to the
UCD SNMP client toolkit. The UCD SNMP Library is based on version
2.1.2.1 of the CMU SNMP Library and has incorporated many bugfixes and
enhancements. For information on the UCD SNMP Library see the
documentation provided with the UCD SNMP distribution.

(NOTE: In previous releases this module was compatible with both the
UCD and CMU SNMP libraries. Starting with Perl5/SNMP-1.7 this module
will only work with the UCD SNMP Library 3.3.1 or later due to
dependence on new features)

Availability:

The most recent release of the UCD SNMP Libray can be found at:
ftp://ftp.ece.ucdavis.edu/pub/snmp/ucd-snmp.tar.gz

The most recent release of the Perl5/SNMP module can be found at:
ftp:/ftp.corpeast.baynetworks.com/netman/snmp/perl5/SNMP.tar.gz
(as well as the usual perl archives, CPAN)

Supported Platforms:
	SunOS 4.1.x
	Solaris 2.x
	Linux 1.2.x, 2.0.x
	Many other UNIX variants
	Win95/NT   ***NEW***

Installation:

build and install ucd-snmp-3.3.1 or later

note: you should ensure that any previous ucd-snmp installation is
completely removed.

perl Makefile.PL
make
make test
make install

note: for 'make test' to succeed you should ensure that an agent running 
(e.g., /usr/local/sbin/snmpd) 

Operational Description:

The basic operations offered by SNMP are provided through an object
oriented interface for modularity and ease of use. The primary class
is SNMP::Session which is implemented as a blessed hash
reference. This class supplies 'get', 'getnext', 'set', 'fget', and
'fgetnext' method calls. All calls are currently blocking/synchronous
(i.e., they must receive a response or timeout before control is
returned to the caller - an asyncronous implementation is very high on
the TODO list). The methods take a variety of input argument formats
(see below).

A description of the fields which can be specified when an
SNMP::Session object is created follows:

SNMP::Session
public:
 DestHost    - default 'localhost', hostname or ip addr of SNMP agent
 Community   - default 'public', SNMP community string (used for both R/W)
 Version     - default '1', [2 (same as 2c), 2c, 3 (not implemented)]
 RemotePort  - default '161', allow remote UDP port to be overriden
 Timeout     - default '1000000', micro-seconds before retry
 Retries     - default '5', retries before failure
 RetryNoSuch - default '1', 'get' request NOSUCH errors in the pdu will
               be repaired, removing the varbind in error, and resent -
               undef will be returned for all NOSUCH varbinds, setting
               to '0' disables this feature and the entire get request
               will fail on any NOSUCH error (applies to v1 only)
 VarFormats  - default 'undef', used by 'fget[next]', holds an hash
               reference of output value formatters, (e.g., {<obj> =>
               <sub-ref>, ... }, <obj> must match the <obj> and format
               used in the get operation. A special <obj>, '*', may be
               used to apply all <obj>s, the supplied sub is called to
               translate the value to a new format. The sub is called
               passing the Varbind as the arg
 TypeFormats - default 'undef', used by 'fget[next]', holds an hash
               reference of output value formatters, (e.g., {<type> =>
               <sub-ref>, ... }, the supplied sub is called to translate
               the value to a new format, unless a VarFormat mathces first
               (e.g., $session->{TypeFormats}{INTEGER} = \&mapEnum();)
 UseLongNames - defaults to the value of SNMP::use_long_names at time
               of session creation. set to non-zero to have <tags>
               for 'getnext' methods generated preferring longer Mib name
               convention (e.g., system.sysDescr vs just sysDescr)
 UseSprintValue - defaults to the value of SNMP::use_sprint_value at time
               of session creation. set to non-zero to have return values
               for 'get' and 'getnext' methods formatted with the libraries
               sprint_value function. This will result in certain data types
               being returned in non-canonical format NOTE: values returned
               with this option set may not be appropriate for 'set' operations
               (see discussion value formats in <vars> description section)
 UseEnums    - defaults to the value of SNMP::use_enums at time of session
               creation. set to non-zero to have integer return values
               converted to enumeration identifiers if possible, these values
               will also be acceptable when supplied to 'set' operations
 ErrorStr    - read-only, holds the error message assoc. w/ last request
 ErrorNum    - read-only, holds the snmp_err or staus of last request
 ErrorInd    - read-only, holds the snmp_err_index when appropriate

private:
 DestAddr    - internal field used to hold the translated DestHost field
 SessPtr     - internal field used to cache a created session structure

methods:
 new(<fields>)   - Constructs a new SNMP::Session object. The fields are
                   passed to the contructor as a hash list
                   (e.g., $session = new SNMP::Session(DestHost => 'foo',
                   Community => 'private');), returns an object reference
                   or undef in case of error.
 update(<fields>)- Updates the  SNMP::Session object with the values fields 
                   passed in as a hash list (similar to new(<fields>))
 get(<vars>)     - do SNMP GET, multiple <vars> formats accepted,
                   updates <vars> with value(s) and type(s), returns
                   retrieved value(s)
 fget(<vars>)    - do SNMP GET like 'get' and format the values according
                   the handlers specified in $sess->{VarFormats} and
                   $sess->{TypeFormats}
 getnext(<vars>) - do SNMP GETNEXT, multiple <vars> formats accepted,
                   returns retrieved value(s), <vars> passed as arguments are
                   updated to indicate next lexicographical <obj>,<iid>,<val>,
                   and <type> NOTE: simple string <vars>,(e.g., 'sysDescr.0')
                   form is not updated
 fgetnext(<vars>)- do SNMP GETNEXT like getnext and format the values according
                   the handlers specified in $sess->{VarFormats} and
                   $sess->{TypeFormats}
 set(<vars>)     - do SNMP SET, multiple <vars> formats accepted,
                   the value field in all <vars> formats must be in a canonical
                   format (i.e., well known format) to ensure unambiguous
                   translation to SNMP MIB data value (see discussion of
                   canonical value format <vars> description section),
                   returns snmp_errno
 getbulk(<non-repeaters>, <max-repeaters>, <vars>)
                 - * Not Implemented *
 trap()          - * Not Implemented *
 
Acceptable variable formats:
<vars> may be one of the following forms:

 SNMP::VarList:  - represents an array of MIB objects to get or set,
                   implemented as a blessed reference to an array of 
                   SNMP::Varbinds, (e.g., [<varbind1>, <varbind2>, ...])

 SNMP::Varbind:  - represents a single MIB object to get or set, implemented as
                   a blessed reference to a 4 element array;
                   [<obj>, <iid>, <val>, <type>].
                   <obj>  - one of the following forms:
                          1) leaf identifier (e.g., 'sysDescr') assumed to be
                             unique for practical purposes
                          2) fully qualified identifier (e.g.,
			     '.iso.org.dod.internet.mgmt.mib-2.system.sysDescr')
                          3) fully qualified, dotted-decimal, numeric OID (e.g.,
                             '.1.3.6.1.2.1.1.1')
                   <iid>  - the dotted-decimal, instance identifier. for
                            scalar MIB objects use '0'
		   <val>  - the SNMP data value retrieved from or being set
                            to the agents MIB. for (f)get(next) operations
                            <val> may have a variety of formats as determined by
                            session and package settings. However for set
                            operations the <val> format must be canonical to
                            ensure unambiguous translation. The canonical forms
                            are as follows:
	                    OBJECTID => dotted-decimal (e.g., .1.3.6.1.2.1.1.1)
			    OCTETSTR => perl scalar containing octets,
		            INTEGER => decimal signed integer (or enum),
			    NETADDR => dotted-decimal,
			    IPADDR => dotted-decimal,
			    COUNTER => decimal unsigned integer,
			    COUNTER64  => decimal unsigned integer,
			    GAUGE,  => decimal unsigned integer,
			    UINTEGER,  => decimal unsigned integer,
                            TICKS,  => decimal unsigned integer,
                            OPAQUE => perl scalar containing octets,
       			    NULL,  => perl scalar containing nothing,


                   <type> - SNMP data type (see list above), this field is
                            populated by 'get' and 'getnext' operations. In
                            some cases the programmer should populate this
                            field when passing to a 'set' operation. this
                            field need not be supplied when attribute
                            indicated by <tag> is already described by loaded
                            Mib modules. for 'set's, if a numeric OID is used
                            and the object is not currently in the loaded Mib,
                            the <type> fileds must be supplied

 simple string   - light weight form of <var> used to 'set' or 'get' a
                   single attribute without constructing an SNMP::Varbind.
                   stored in a perl scalar, has the form '<tag>.<iid>',
                   (e.g., 'sysDescr.0'). for 'set' operations the value
                   is passed as a second arg. NOTE: This argument form is
                   not updated in get[next] operations as are the other forms.

SNMP package variables and functions:

 $SNMP::VERSION       - the current version specifier (e.g., 1.7)

 $SNMP::auto_init_mib - default '1', set to 0 to disable automatic reading
                        of the MIB upon session creation. set to non-zero
                        to call initMib at session creation which will result
                        in MIB loading according to UCD env. variables (see
                        man mib_api)

 $SNMP::verbose       - default '0', verbosity level, 0 => no output

 $SNMP::use_long_names - default '0', set to non-zero to enable the use of
                        longer Mib identifiers. see translateObj. will also
                        influence the formatting of <tag> in varbinds returned
                        from 'getnext' operations. Can be set on a per session
                        basis (UseLongNames)

 $SNMP::use_sprint_value - default '0', set to non-zero to enable formatting of
                        response values using the snmp libraries sprint_value
                        function. can also be set on a per session basis (see
                        UseSprintValue) NOTE: returned values may not be
                        suitable for 'set' operations

 $SNMP::use_enums     - default '0',set non-zero to return values as enums and
                        allow sets using enums where appropriate. integer data
                        will still be accepted for set operations. can also be
                        set on a per session basis (see UseEnums)

 &SNMP::setMib(<file>) - allows dynamic (re?)parsing of the mib and explicit
                        specification of mib file independent of enviroment
                        variables. called with no args acts like initMib,
                        loading MIBs indicated by environment variables (see
                        ucd mib_api docs). passing non-zero second arg
                        forces previous mib to be freed and replaced 
                        (note: second arg not working since freeing previous 
                         Mib is more involved than before).

 &SNMP::initMib()     - calls library init_mib function if Mib not already
                        loaded - does nothing if Mib already loaded. will
                        parse directories and load modules according to
                        environment variables described in UCD documentations.
                        (see man mib_api, MIBDIRS, MIBS, MIBFILE(S), etc.)

 &SNMP::addMibDirs(<dir>,...) - calls library add_mibdir for each directory
                        supplied. will cause directory(s) to be added to
                        internal list and made available for searching in
                        subsequent loadModules calls

 &SNMP::addMibFiles(<file>,...) - calls library read_mib function. The file(s)
                       supplied will be read and all Mib module definitions
                       contained therein will be added to internal mib tree
                       structure

 &SNMP::loadModules(<mod>,...) - calls library read_module function. The
                       module(s) supplied will be searched for in the
                       current mibdirs and and added to internal mib tree
                       structure. Passing special <mod>, 'ALL', will cause
                       all known modules to be loaded.

 &SNMP::unloadModules(<mod>,...) - *Not Implemented*

 &SNMP::translateObj(<var>) - will convert a text object tag to an OID and
                            vice-versa. iid suffix is retained numerically.
                            default behaviour when converting a numeric OID
                            to text form is to return leaf indentifier only
                            (e.g.,'sysDescr') but when $SNMP::use_long_names
                            is non-zero the whole identifier will be returned

 &SNMP::getType(<var>) - return SNMP data type for given textual identifier
                        OBJECTID, OCTETSTR, INTEGER, NETADDR, IPADDR, COUNTER
                        GAUGE, TIMETICKS, OPAQUE, or undef

 &SNMP::mapEnum(<var>) - converts integer value to enumertion tag defined
                        in Mib *Not Implemented*

Trouble Shooting:

If problems occur there are number areas to look at to narrow down the
possibilities.

The first step should be to test the UCD installation independent from
the Perl5/SNMP interface. 

Try running the apps from the UCD distribution. 

Ensure that your MIBs are installed and enviroment variables are set
appropriately (see man mib_api)

Be sure to remove old ucd-snmp installations

If the problem occurs during compilation/linking check that the snmp
library being linked is actually the UCD library (there have been name
conflicts with existing snmp libs). 

Also check that the header files are correct and up to date. 

Sometimes compiling the UCD snmp library with
'position-independent-code' enabled is required.

if you cannot resolve the problem you can email me at
gmarzot@baynetworks.com and/or ucd-snmp-coders@ece.ucdavis.edu.
and maybe I can help.

please give sufficient information to analyze the problem (OS type,
versions for OS/Perl/UCD/compiler, complete error output, etc.)

Acknowledments:

Many thanks to all those who supplied patches, suggestions and
feedback. 

Wes Hardaker and the ucd-coders
Dave Perkins
Marcel Wiget
David Blackburn
John Stofell
Gary Hayward
Claire Harrison
Achim Bohnet
Doug Kingston
Jacques Vidrine
Perl5 Porters

Apologies to any/all who's patch/feature/request was not mentioned or
included - most likely it was lost when paying work intruded on my
fun. Please try again if you do not see a desired feature. This may
actually turn out to be a decent package with such excellent help and
the fact that I have more time to work on it than in the past.

bugs, comments, questions to gmarzot@baynetworks.com

------
History:

Bugs fixed and changes in 1.7

1) fixed seg fault on use of unknown/unparsed attribute in Varbind or
   passed to translateObj

2) fixed truncation of last char of attribute name in translateObj

3) handles variable args to setMib without complaint

4) added SNMP::getType to query data type of a given attribute and
   extended Varbind structure to return type wherever possible

5) added RemotePort to SNMP::Session initialation list to allow override
   of port 161

6) removed noisy announcement of mib parse success unless verbose is set

	       *WARNING*  *this may break existing scripts*
7) changed return format for IpAddress and ObjID data types - these are
   now always returned as dotted decimal strings as opposed to the
   packed binary forms in 1.6
	       *WARNING*  *this may break existing scripts*

8) Session now sets ErrorInd (e.g., $session->{ErrorInd}) where appropriate

9) Support for ucd-snmp-3.2 (and greater) style of Mib loading

10) Fully qualified attriubute names and numeric OIDs are now valid <obj>
   defintions.

11) Numeric OIDs can be used even if they have not been parsed in the
    current Mib - Mib loading is now optional

12) Support for Win32 perl

13) Updated docs and examples

14) Reworked/extended the test harness to use the perl t/* facility
    (thanks to jfs@fluent.com)

15) fixed up error handling to be more consistent with library and more
    useful in general. Now returns both library API errors and snmp
    protocol error numbers and strings.

16) added per object and per type formatting of returned values - more
    control of value formatting with UseEnums and UseSprintValue

-- 
 G. S. Marzot <gmarzot@baynetworks.com>   Network Management Development
 Bay Networks Inc.                        (508)670-8888 x63990
--




------------------------------

Date: 2 Jan 1998 23:55:16 GMT
From: Michael Peppler <mpeppler@mbay.net>
Subject: ANNOUNCE: sybperl 2.09
Message-Id: <68jup4$bob$1@news1.teleport.com>

I have just uploaded sybperl 2.09 to CPAN - it will reach
your favorite site in a few days. Here's a brief description of
what has changed in this release:

This is sybperl 2.09.
---------------------

This release includes significant performance improvements, as 
well as now being portable to Win32 and VMS systems, as well as 
the traditional Unix systems, thanks to Charles Bailey for the 
VMS patches and Krzysztof Koczyjan for the Win32 patches.

Performance improvements:
-------------------------
The connection attributes ($dbh->{UseDateTime}, etc) used to be 
stored in real perl hash, which, when -DDO_TIE was set, would call 
some perl code every time you access it. It is now emulated (stored 
in a C struct) which improves speed tremedously (especially in DBlib
which makes heavy use of attributes).

dbnextrow() and ct_fetch() can now return a reference to a hash or an
array. This feature is enabled via a new $wantRef parameter to these
functions. The value of $wantRef defaults to false, to keep
compatibility with any old scripts.

This also improves speed because I can pre-allocate the array on the
first fetch, and then simply set the values as required on each
subsequent fetch.

Other enhancements:
-------------------
Certain connection properties can now be set when opening the
connection in Sybase::CTlib:

	  $dbh = new Sybase::CTlib $user, $pwd, $server, $appname,
	       { CON_PROPS => { CS_PACKETSIZE => 1024}};

The following properties are supported:
	CS_HOSTNAME
	CS_ANSI_BINDS
	CS_CHARSETCNV
	CS_PACKETSIZE
	CS_SEC_APPDEFINED
	CS_SEC_CHALLENGE
	CS_SEC_ENCRYPTION
	CS_SEC_NEGOTIATE

You can now specify date formats in Sybase::CTlib via the cs_dt_info()
call.

Sybase::DBlib now understands dbsetdefcharset() and dbsetdeflang().

Portability:
------------
Thanks to Charlse Bailey, sybperl 2.09 should build on VMS systems,
and thanks to Krzysztof Koczyjan it should also build on Win32 
systems - please see the README.win32 for details.


As usual comments, criticism, etc. welcome!

Michael
-- 
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler




------------------------------

Date: 2 Jan 1998 23:53:53 GMT
From: tye@metronet.cdom (Tye McQueen)
Subject: ANNOUNCE: Tie::Registry beta, new Win32API::Registry
Message-Id: <68jumh$bm6$1@news1.teleport.com>

WHAT

I'm proud to announce the first beta release of Tie::Registry,
a Perl module to provide easy and powerful access to a Registry
(Microsoft's configuration database thingy and the module is only
supported on Win32 systems at this time).  I've also released a
new version of Win32API::Registry which is required by this
release of Tie::Registry.

As the name suggests, Tie::Registry lets you use tied hashes
to use a Registry very easily.  Tie::Registry also provides an
object-oriented interface which meshes nicely with the tied hash
interface and the underlying Win32API::Registry "raw" interface.
Now 90% of what you want to do with a Registry can be done very
simply, and you can do anything in Perl that you could do in C
(at least as easily).

Imagine being able to copy an entire Registry tree with a single
Perl statement (okay, enough hype):
    $classes->{"gnatfile/"}= $classes->{"batfile/"};

Sorry, Tie::Registry cannot be used with the ActiveState version
of Perl because Tie::Registry requires Win32API::Registry which
uses the standard Perl tools for building extensions and these
are not supported with the ActiveState version of Perl.  The
ActiveState version and standard version of Perl are merging
so you _may_ want to switch to the standard version of Perl soon.

You probably need a C compiler to use Win32API::Registry which
is required by Tie::Registry, but see the next section for a
possible work-around.


WHERE

I have just uploaded to PAUSE:

    Tie-Registry-0.12.zip
    Win32API-Registry-0.12.zip

so they will be available soon at your local CPAN site in the
authors/id/TYEMQ directory.

For a limited time, these are also available under
http://www.metronet.com/~tye/alpha/ as

    Tie-Registry-0.12.zip
    Win32API/Registry-0.12.zip
    Win32API/Registry-0.12bin.zip
    perl5.004_04tm.patch

Win32API/Registry-0.12bin.zip _may_ be useful for those without a
C compiler and with Perl5.004_04 built similar enough to my copy. 
perl5.004_04tm.patch is a patch for the source code of Perl
version 5.004_04 that ties $^E to GetLastError() to make life
under Win32 nicer, especially when using these modules [it has
been submitted to the perl5-porters and I hope will be included
in future releases of Perl].


DETAILS (Tie::Registry)

See Tie/Registry.pm for full [pod] documentation [though some
sections are still under construction].

The Tie::Registry module lets you manipulate the Registry via
objects [as in "object oriented"] or via tied hashes.  But you
will probably mostly use objects which are also references to
tied hashes that allow you to mix both access methods.

By default, Tie::Registry exports one global variable, $Registry,
which is a combination of a Perl object and a reference to a
tied hash and represents the virtual "root" of the Registry.
Use $Registry as a reference to a tied hash [as in,
$Registry->{"KeyName/"}] to open Registry keys and you get more
objects/references-to-tied-hashes.  Use these or $Registry to make
Tie::Registry method calls [as in $key->Information("Class")]
and/or as references to tied hashes [as in $key->{"/ValueName"}]
to do just about anything with the Registry.

Summary of using tied hashes

For the impatient, this may be the only documentation you need
to read to get started.  For best results, always append one
delimeter to the end of each Registry key name and prepend one
delimeter to the front of each Registry value name.

The root keys for use with $Registry are:
    Classes             HKEY_CLASSES_ROOT
    CUser               HKEY_CURRENT_USER
    LMachine            HKEY_LOCAL_MACHINE
    Users               HKEY_USERS
    PerfData            HKEY_PERFORMANCE_DATA
    CConfig             HKEY_CURRENT_CONFIG
    DynData             HKEY_DYN_DATA
Note that upper vs. lower case letters matter for these (but not
for other subkey names nor value names).

Opening keys

    use Tie::Registry;				# Exports $Registry.
    $Registry->Delimeter("/");                  # Set delimeter to "/".

    $swKey= $Registry->{"LMachine/Software/"};
    $winKey= $swKey->{"Microsoft/Windows/CurrentVersion/"};
    $userKey= $Registry->
      {"CUser/Software/Microsoft/Windows/CurrentVersion/"};

    $remoteKey= $Registry->{"//HostName/LMachine/"};
    # Run ``net use \\HostName\ipc$ /user:UserName PassWord'' first, if needed.

Reading values

    $progDir= $winKey->{"/ProgramFilesDir"};    # "C:\\Program Files"
    $tip21= $winKey->{"Explorer/Tips//21"};     # Text of tip #21.

    $winKey->ArrayValues(1);
    ( $devPath, $type )= $winKey->{"/DevicePath"};
    # $devPath eq "%SystemRoot%\\inf"
    # $type eq "REG_EXPAND_SZ"  [if you have SetDualVar.pm installed]
    # $type == REG_EXPAND_SZ  [if you did "use Win32API::Registry qw(REG_)"]

Setting values

    $winKey->{"Setup//SourcePath"}= "\\\\SwServer\\SwShare\\Windows";
    # Simple.  Assumes data type of REG_SZ.

    $winKey->{"Setup//Installation Sources"}=
      [ "D:\x00\\\\SwServer\\SwShare\\Windows\0\0", "REG_MULTI_SZ" ];
    # "\x00" and "\0" used to mark ends of each string and end of list.

    $userKey->{"Explorer/Tips//DisplayInitialTipWindow"}=
      [ pack("L",0), "REG_DWORD" ];
    $userKey->{"Explorer/Tips//Next"}= [ pack("S",3), "REG_BINARY" ];
    $userKey->{"Explorer/Tips//Show"}= [ pack("L",0), "REG_BINARY" ];

Adding keys

    $swKey->{"FooCorp/"}= {
        "FooWriter/" => {
            "/Version" => "4.032",
            "Startup/" => {
                "/Title" => "Foo Writer Deluxe ][",
                "/WindowSize" => [ pack("LL",$wid,$ht), REG_BINARY ],
                "/TaskBarIcon" => [ "0x0001", REG_DWORD ],
            },
            "Compatibility/" => {
                "/AutoConvert" => "Always",
                "/Default Palette" => "Windows Colors",
            },
        },
        "/License", => "0123-9C8EF1-09-FC",
    };

Listing all subkeys and values

    @members= keys( %{$swKey} );
    @subKeyNames= grep(  m#^/#,  keys( %{$swKey->{"Classes/batfile/"}} )  );
    # @subKeyNames= ( "/", "/EditFlags" );
    @valueNames= grep(  ! m#^/#,  keys( %{$swKey->{"Classes/batfile/"}} )  );
    # @valueNames= ( "DefaultIcon/", "shell/", "shellex/" );

Deleting values or keys with no subkeys

    $oldValue= delete $userKey->{"Explorer/Tips//Next"};

    $oldValues= delete $userKey->{"Explorer/Tips/"};
    # $oldValues will be reference to hash containing deleted keys values.

Closing keys

    undef $swKey;               # Explicit way to close a key.
    $winKey= "Anything else";   # Implicitly closes a key.
    exit 0;                     # Implicitly closes all keys.

Installation

Tie::Registry installs like any standard Perl module.  First, get and
install the Win32API::Registry module.  For best results, also get and
install the SetDualVar module and make sure your Perl distribution
included the Win32::WinError module.

Then you can use the following commands to install Tie::Registry:

    unzip Tie-Registry-0.12.zip
    cd Tie-Registry-0.12
    perl Makefile.PL
    make install        [or "nmake install"]

Or, if you don't have a "make" command [usually as part of a C
compiler], you can get away with simply copying the Registry.pm
file into theh "Tie" subdirectory of Perl's "lib" directory.

SEE ALSO

Win32API::Registry(3) [required] - Provides Reg*(), HKEY_*, KEY_*, REG_*.

Win32::WinError(3) [optional] - Defines ERROR_* values.

SetDualVar(3) [optional] - For returning REG_* values as combo string/integer.
--
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
       Remove d's from address to reply (sorry for the inconvenience).




------------------------------

Date: 2 Jan 1998 23:54:39 GMT
From: sugalskd@osshe.edu (Dan Sugalski)
Subject: ANNOUNCE: VMS::Persona 1.00
Message-Id: <68junv$bn7$1@news1.teleport.com>
Keywords: VMS persona setuid

Announcing VMS::Persona 1.0

This module provides an interface to the persona system services provided
in VMS 6.2 and higher. You can, if your process has the appropriate
privileges, assume the identity of another user on the system.

Unlike the DCL command SET UIC, you get more than a UIC change.
Privileges, rights, UIC, and username, amongst other things, are assumed
by the process, providing a security environment wquivalent to the account
who's persona is being assumed.

Currently whizzing around CPAN at
$CPAN/modules/by-authors/Dan_Sugalski/VMS_Persona-1_00.zip and available
at a fine mirror near you.

					Dan




------------------------------

Date: Fri, 02 Jan 1998 15:52:37 -0600
From: markfolse@rocketmail.com (Mark Folse)
Subject: Camel book v. Win32
Message-Id: <markfolse-0201981552530001@192.168.254.2>

Not to change the subject (well, yes to change the subject slightly) is
the Camel Book presumably as UNIX-centric as the Llama book? Is it a good
investment for someone stranded behind the Windows in DOSneyland? 

(Well now that I'm in NT I really need to lose that last bit about
DOSneyland, but nothing I can think of offhand sounds half as clever. I'm
really going to miss it).

In article <34AD4EDF.15FB@bell-labs.com>, Stephan Vladimir Bugaj
<bugaj@bell-labs.com> wrote:

>> Another question: I'm considering buying either "Learning Perl" or "Learning
>> Perl on win32 systems". They are rougly same size and one (or more?) of
makers
>> seem to be same. So which would be better? I'm an NT-person but I'm after a
>> good Perl book.
>> 
>I have the Perl4 original and the Perl5 Win32 of Learning Perl and
>have skimmed through the Perl5 regular version and they're all fairly
>similar.  If you're on NT there's no reason not to get the Win32
>version. I bought it just to upgrade my Perl4 version of LP and to
>get free bonus info about Perl on NT in case I ever need it.  They're
>pretty much the same book, really, but the Win32 has some tailored
>Win bits in it.
>
>A great book on RegExps which I got because I'm a RegExp newbie is
>J. Friedl's Mastering Regular Expressions.
>
>
>LL+P,
>Stephan
>
>  
>                    "Do computers think?"
>---------------------------------------------------------------
>Stephan Vladimir Bugaj, Multimedia Communication Research Dept.
>Departmental Website:       http://www.multimedia.bell-labs.com
>PGPkey from http://www.pgp.net/wwwkeys.html or other keyservers
>Non-Lucent website:     http://www.cthulhu-dynamics.com/stephan
>FAQs:     http://www.cthulhu-dynamics.com/tech/metametafaq.html 
>---------------------------------------------------------------
>    STANDARD DISCLAIMER:My opinions are NOT those of LUCENT
>---------------------------------------------------------------
>             "Do submarines swim?" - E.W. Dijkstra

-- 
-- 
   Mark Folse * IS Manager * DL Printing * Detroit Lakes, MN  USA 
           www.dlprinting.co * mfolse at dlprinting dot com
      I filter all mail and news to null which beings with <HTML>...
--------------------------------------------------------------------


------------------------------

Date: Fri, 02 Jan 1998 16:30:18 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Convert GET to POST
Message-Id: <comdog-ya02408000R0201981630180001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34AD4E39.C508E074@iu.net>, Stephen Cobb <stephen@iu.net> posted:


>The line Print "Location :
>http://www.foo.com/cgi-bin/test.pl?Name=Joe\n\n"; 
>works fine but it uses the GET method resulting in an untidy URL string. 
>
>Can anyone point me to code for doing this same thing but using the POST
>method. I can find 100s of examples of GET but not POST ;-(

that should give you some clue about using the POST method for 
this.  however, if you still want to do this, you should look at
the LWP modules.

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue on Fire! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


------------------------------

Date: 02 Jan 1998 16:38:12 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: Stephen Cobb <stephen@iu.net>
Subject: Re: Convert GET to POST
Message-Id: <8cu3bm30rf.fsf@gadget.cscaper.com>

>>>>> "Stephen" == Stephen Cobb <stephen@iu.net> writes:

Stephen> I'm trying to write a perl cgi script that reads the input
Stephen> from a form and then sends that input on to another perl
Stephen> script.

Stephen> The line Print "Location :
Stephen> http://www.foo.com/cgi-bin/test.pl?Name=Joe\n\n"; works fine
Stephen> but it uses the GET method resulting in an untidy URL string.

Stephen> Can anyone point me to code for doing this same thing but
Stephen> using the POST method. I can find 100s of examples of GET but
Stephen> not POST ;-(

This question belongs in CIWAC, not here.  The answer is the same no
matter what language you are using, so it's not a Perl question.  But
since you asked it here...

No... you cannot perform an external redirect (printing location:) and
have it trigger a POST.  Only a GET.  The problem is that you don't
have anywhere to give the content.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 241 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


------------------------------

Date: Fri, 2 Jan 1998 15:48:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Stephen Cobb <stephen@iu.net>
Subject: Re: Convert GET to POST
Message-Id: <Pine.GSO.3.96.980102154751.26534g-100000@user2.teleport.com>

On Fri, 2 Jan 1998, Stephen Cobb wrote:

> I'm trying to write a perl cgi script that reads the input from a form
> and then sends that input on to another perl script. 

Use the LWP module. Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: 2 Jan 1998 17:09:42 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Help on writing perl.
Message-Id: <68joj6$3qa$1@stok.co.uk>

In article <883777456.11002.0.nnrp-03.c1ed222a@news.demon.co.uk>,
Ian Gregson <iang@sytecuk.demon.co.uk> wrote:

>I am looking for all the tools to help me write a perl script. I know I need
>an editor which I presume would be EMACS ?? I have the perl documentation
>but I am very confused.

Any editor which can generate simple text files should do, do youhave a
favourite editor already?  Quite often familiarity with the editor is more
important than features offered to begin with (and choice of editor can be
an almost religious issue...)  If you're trying to learn a new language
then you should probably put off selecting a new editor unless you don;t
already have one.

>Do I need to a compiler ?
>Do I need an interpreter ?

You need a perl interpreter.  For most environments it's possible to getr
the source from a Comprehensive Perl Archive Network (CPAN) site, if you
have web access then http://www.perl.com has pointers to CPAN on it, if
you have ftp access then the CPAN master site is on ftp.funet.fi under
/pub/languages/perl/CPAN (and you will find a list of mirror sites which
may contain more convenient sites for you.)

>Does anyone know where I can actually get these files/utilities from ?
>
>I am a visual basic programmer by profession but to write an application
>that needs to run on a UNIX server I believe I need to resort to Perl.

Which unix system?  Many of the "free" unix distributions copme with some
version of perl.  You can ususally tell which version is installed by
using the perl -v (version) command e.g.

[mike@stok mike]$ perl -v

This is perl, version 5.004_04 built for i586-linux

Copyright 1987-1997, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

([mike@stok mike]$ is my unix shell prompt)  If you have a version older
than 5.004 it's probably worth getting a newer version installed - if you
have a systems administrator then they're the person to ask.  If you have
to install it yourself then you should rummage around on the www.perl.com
site, http://www.perl.com/latest.html lists systems for which building
perl is a relatively simple exercise as long as you have a C compiler.

These are just some initial pointers which I hope will help,

Mike


-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


------------------------------

Date: Fri, 2 Jan 1998 16:36:54 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ian Gregson <iang@sytecuk.demon.co.uk>
Subject: Re: Help on writing perl.
Message-Id: <Pine.GSO.3.96.980102162541.26534p-100000@user2.teleport.com>

On Fri, 2 Jan 1998, Ian Gregson wrote:

> Subject: Help on writing perl.

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> I am looking for all the tools to help me write a perl script. I know I
> need an editor which I presume would be EMACS ??

It could be, but it could be any other text editor, such as vi or pico, or
a graphical editor. You could even edit on another machine and upload the
text when you're done. (Randal says his favorite text editor is 
"cat >filename". :-) 

> I have the perl documentation but I am very confused. 
> 
> Do I need to a compiler ?
> Do I need an interpreter ?

Those services are performed by the perl binary, which may be already
installed on your machine. Usually the command 'perl -v' (without the
quotes) will tell you about your perl binary. If the version installed is
old, you should ask somebody at your site to install the current version.
(That's currently 5.004_04.) 

> Does anyone know where I can actually get these files/utilities from ?

You could probably benefit from the Perl FAQ, especially sections 1 and 2. 
If you don't already have recent Perl docs, you should be able to find the
docs (which include the FAQ) via this URL.

    http://www.perl.com/CPAN/doc/manual/html/pod/

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



------------------------------

Date: 2 Jan 1998 23:36:07 GMT
From: kortbein@iastate.edu (Josh Kortbein)
Subject: Re: Help with calculating Gunning (reading level) index for documents
Message-Id: <68jtl7$4eg$1@news.iastate.edu>

M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote:
: Bass Player <fenderbass@evang.com> wrote:
: >$GFI = int(( (100/$b) + $c) *0.4 ))
: >
: >The biggest stumbling block is trying to determine the number of syllables in 
: >a particular word. Anyone got any help on this?

: That's really a question for a linguist, not for Perl.   And in general
: it's difficult to answer, with lots of special cases.

Hmmmm... a linguist, you say?? I hear there a few linguistically-inclined 
perl programmers running around. :)


Josh

--

___________________________________________________________________________
"So, would you say it's about time for our viewers to... crack each others'
 heads open and feast on the goo inside?"
"Yes. Yes I would, Kent." 



------------------------------

Date: Fri, 02 Jan 1998 16:34:49 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help!: Sample HTTP POST request needed.
Message-Id: <comdog-ya02408000R0201981634490001@news.panix.com>
Keywords: from just another new york perl hacker

In article <34AD35B9.2FA9@skybound.demon.nl>, Craig Manley <Craig@skybound.demon.nl> posted:


>I want to execute a CGI script from a Java applet using a HTTP POST
>request, sending a few field=value combinations just as a HTML form
>would. Has anybody got a sample on how such a request header+body could
>look.

the CGI Meta FAQ has references to the HTTP specification as well
as other documents which have the definitive answer to your question.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
Fifth Avenue on Fire! <URL:http://computerdog.com/brian/fire/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


------------------------------

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1571
**************************************

home help back first fref pref prev next nref lref last post