[8112] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1730 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 26 10:07:41 1998

Date: Mon, 26 Jan 98 07:00:55 -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           Mon, 26 Jan 1998     Volume: 8 Number: 1730

Today's topics:
         How do you "force" perl to look only in a selected dir roberts_d@bms.com
    Re: _Effective Perl Programming_ (Andy Lester)
    Re: Accpeting command line input such as ".- .." <dballing@speedchoice.com>
    Re: BASE64 Decode (Clay Irving)
        Check Variable type <Daniel.Balderman@digital.com>
        CSV (comma separated, quoted) <kordsmen@kordsmen.org>
    Re: CSV (comma separated, quoted) (Andy Lester)
    Re: Decrypting modules for Perl <davidu@electriciti.com>
    Re: Decrypting modules for Perl <davidu@electriciti.com>
    Re: Decrypting modules for Perl (Clay Irving)
        df <warchie@att.net.hk>
    Re: FAQ too big (Was: Re: PERL forking) (Andrew M. Langmead)
    Re: Fed up with CGI.pm (Chip Salzenberg)
    Re: Help with opening and copying to a file (Chip Salzenberg)
    Re: help: open an existing page and replace parts of it <ebohlman@netcom.com>
        Hotmail Script <warchie@att.net.hk>
    Re: How do you "force" perl to look only in a selected  (Chip Salzenberg)
        Larry's Quotes <jerryp.usenet@connected.demon.co.uk>
    Re: Larry's Quotes <aprilk@dancris.com>
    Re: MacPerl CD-ROM, Version 0.5 (Jvrg Kantel)
    Re: MacPerl CD-ROM, Version 0.5 (Chris Nandor)
    Re: newbie perl programmer requests help (MAC) (Chris Nandor)
        PERL report problem (john kelly)
    Re: Problems with DBFile (Paul Marquess)
    Re: questions about *DB* usage (Paul Marquess)
        search script for perl win'95 r.breman@student.utwente.nl
        User Adminstration with Win32::netadmin <welcome@bildbau.de>
    Re: White Hats and Black <flavell@mail.cern.ch>
    Re: White Hats and Black (Chris Nandor)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 26 Jan 1998 07:51:32 -0600
From: roberts_d@bms.com
To: roberts_d@bms.com,roberts_d@juno.com
Subject:  How do you "force" perl to look only in a selected directory for certain files??
Message-Id: <885820158.92340227@dejanews.com>

Hello
I am wondering how you "force" perl code to look only in certain
directories for code.
What I have done is taken all the code associated with the production
Oracle/Web/Perl driven database and copied it over into my separate area
on the server.
The purpose is that I want to test some things in my area without
affecting the production area as well as not using any of the production
code.
so.
the production code is in
/usr/BIKE and under the BIKE dir are several dirs ie. BIKE/pl  BIKE/HTML
and etc

so..
I copied everything from BIKE
to a brand new BIKE dir under /usr/Dan
/usr/Dan/BIKE including all the associated file and directories.  Now
the question is.

Then I can bring up a netscape page which points to the new files in
/usr/Dan/BIKE but none of my form actions work since, the perl is
looking in the wrong directory.

How can I force perl now to look only in the directory tree under
/usr/Dan/BIKE for code instead of trying to use code in which is located
in /usr/BIKE

I think I have to use a lib or require stmt..but I am having a tough
time sorting this out..>Thanks for any and all help!!!.>Dan

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 26 Jan 1998 14:39:03 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: _Effective Perl Programming_
Message-Id: <6ai767$65n$1@usenet40.supernews.com>

:     I don't use English. It's just too verbose for this little book.
:     Furthermore, English is not common practice among Perl
:     programmers, and scripts that use English suffer a speed penalty.
:     This is not to say that English is not useful, just that you won't
:     see it here.

My use of English: If I have to use a special $variable that requires me
to pick up a copy of the book to know what it is, I use English.
Effectively, that means that if I have to use anything besides $_ or $&, I
use it.  But that's just me.

Something that's struck me as vaguely annoying about _Effective Perl
Programming_, ( and I DO love the book) is the continual mentions of
speed.  Granted, the "use English incurs a 50% speed hit immediately" is
worth noting, but in general, he seems to be very concerned with speed.
Me, I try always to remember "Premature optimization is the root of all
evil", and eschewing English in favor of a speed increase seems premature
to me.

xoxo,
Andy


--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Mon, 26 Jan 1998 07:49:42 -0600
From: Derek Balling <dballing@speedchoice.com>
Subject: Re: Accpeting command line input such as ".- .."
Message-Id: <7A56167D5804CD4D.151B4FF0CB8ED4C3.075EC0D2F2E32A2C@library-proxy.airnews.net>

brian d foy wrote:
> 
> In article <6aeg0e$36u@nntp02.primenet.com>, Jerald Jackson <jsjacks@primenet.com> posted:
> 
> >I am trying to write a basic morse translation script.  It works
> >jsut fine when I read input from a file, but when I attempt to
> >pass it code from the command line, I get errors that it cannot find
> >a file ".-" or whatever character I passed it.  The strange thing
> >was that the letter e "." works from the command line but ".." will
> >print "e e e".
> 
> >Ideas?
> 
> perhaps a peek at the source would be useful... :)

As well as a very possibly key question - what shell is he using? That
almost sounds like the shell is trying to pass a verified filename to
the perl script and coughing up an error message.


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

Date: 26 Jan 1998 09:10:28 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: BASE64 Decode
Message-Id: <6ai5gk$37h@panix.com>

In <6agv81$4eh$1@winter.news.erols.com> "The Smiths" <smiths@erols.com> writes:

>Hi,

Howdy.

>Before I write one, I was wondering if a BASE64 decode routine might already
>be available in PERL?

There is.

Oh? Did you want to know where? :)

  MIME-tools
  http://www.perl.com/CPAN/authors/Eryq/
  This toolkit allows you to parse and/or construct MIME messages; e.g., 
  email messages with attachments. The modules have been ported to Win32, 
  and pass the tests under Win95 using the GS port of Perl5.004. 

Perl Reference: conversion
http://reference.perl.com/query.cgi?conversion

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Mon, 26 Jan 1998 14:11:48 +0200
From: Daniel Balderman <Daniel.Balderman@digital.com>
Subject: Check Variable type
Message-Id: <34CC7D84.5B4@digital.com>

Hi,

I'm writing a WEB application where the user has to enter an integer.
How can I check the user input to see if the user has entered the
correct type (in this case integer).

Thanks,
Daniel Balderman
Daniel.Balderman@digital.com


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

Date: Mon, 26 Jan 1998 09:21:24 -0500
From: Ken Stevens <kordsmen@kordsmen.org>
Subject: CSV (comma separated, quoted)
Message-Id: <34CC9BE3.8F89D5A@kordsmen.org>

I am very new to Perl programing... I have installed a great program
called PerlShop that works wonderfully.  The only problem is that it
saves the data in CSV

ie:   "John","Doe", "somestreet","Someplace","25031",  etc etc etc.

the other problem is each record is its own file and is a random number

ie:  2345678.304

is there a Perl utility to put this in human form?  Or can some one help
me with a sort Who to....





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

Date: 26 Jan 1998 14:41:33 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: CSV (comma separated, quoted)
Message-Id: <6ai7at$65n$2@usenet40.supernews.com>

Ken Stevens (kordsmen@kordsmen.org) wrote:
: I am very new to Perl programing... I have installed a great program
: called PerlShop that works wonderfully.  The only problem is that it
: saves the data in CSV

Look for the Text::CSV module.

xoxo,
Andy





--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: Sun, 25 Jan 1998 13:03:28 -0800
From: David <davidu@electriciti.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Decrypting modules for Perl
Message-Id: <Pine.SUN.3.96.980125130253.20837A-100000@circuit>

Thanx,
I checked it out, I might just have to write my own.  Actually the PGP
looks interesting, but I am not familier with how to use PGP.
-David U

o============o  Sending unsolicited commercial e-mail (UCE)  to this address
 Legal Notice   is indication of your consent to pay me $120/hour for 1 hour
o============o  minimum of HTML programming for 1 web page maximum.
 Guts- davidu@eciti.com * www.eciti.com/~davidu/ * www.eciti.com/support

On Sun, 25 Jan 1998, Tom Phoenix wrote:

> On Sun, 25 Jan 1998, David wrote:
> 
> > I look at CPAN, and couldn't find anything that simply encrypted data, and
> > decrypted data, If you have seen a perl script that does that, let me know
> > please.
> 
>     http://www.perl.org/CPAN/modules/by-category/
> 	14_Authentication_Security_Encryption/
> 
> If none of the modules there seems to do what you need, you're welcome to
> submit your own. Hope this helps! 
> 
> -- 
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
> 
> 



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

Date: Sun, 25 Jan 1998 11:42:16 -0800
From: David <davidu@electriciti.com>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Decrypting modules for Perl
Message-Id: <Pine.SUN.3.96.980125113531.20637A-100000@circuit>

Tom,
I look at CPAN, and couldn't find anything that simply encrypted data, and
decrypted data, If you have seen a perl script that does that, let me know
please.
-Thank you,
David U.

o============o  Sending unsolicited commercial e-mail (UCE)  to this address
 Legal Notice   is indication of your consent to pay me $120/hour for 1 hour
o============o  minimum of HTML programming for 1 web page maximum.
 Guts- davidu@eciti.com * www.eciti.com/~davidu/ * www.eciti.com/support

On Sun, 25 Jan 1998, Tom Phoenix wrote:

> On Sat, 24 Jan 1998, David wrote:
> 
> > I have written a perl script that takes input, incrypts it via 'crypt,' and
> > then stores it in a file.  I need to be able to decrypt this file
> 
> If you're talking about the same crypt() that I am, it's a one-way
> function. There's no way to turn the sausage back into a pig. If you want
> two-way encryption, there are some Perl modules on CPAN which can help you
> out. Hope this helps!
> 
> -- 
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
> 
> 




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

Date: 26 Jan 1998 08:59:17 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Decrypting modules for Perl
Message-Id: <6ai4rl$2b7@panix.com>

In <Pine.SUN.3.96.980125113531.20637A-100000@circuit> David <davidu@electriciti.com> writes:

>I look at CPAN, and couldn't find anything that simply encrypted data, and
>decrypted data, If you have seen a perl script that does that, let me know
>please.

You didn't look hard enough:

  http://www.perl.com/CPAN/modules/by-module/Crypt/

There's Crypt-DES-1.0.tar.gz and Crypt-IDEA-1.0.tar.gz -- Both of them
provide encrypt and decrypt functions. For example:


    use Crypt::DES;
    
	my $cipher = new DES $key;
	my $ciphertext = $cipher->encrypt($plaintext);

	$plaintext = $cipher->decrypt($ciphertext);

or

    use Crypt::IDEA;

        my $cipher = new IDEA $key;
	my $ciphertext = $cipher->encrypt($plaintext);

        $plaintext = $cipher->decrypt($ciphertext);

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Sun, 25 Jan 1998 10:58:43 +0800
From: Walter Archie <warchie@att.net.hk>
Subject: df
Message-Id: <34CAAA63.C5B0C962@att.net.hk>

df



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

Date: Mon, 26 Jan 1998 14:15:23 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: FAQ too big (Was: Re: PERL forking)
Message-Id: <EnEA9n.C6s@world.std.com>

"Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> writes:

>Since grep doesn't come with Windows out of the box, most Windows users
>probably don't know it exists. Sad, I know, but true.

But the title of this thread is "FAQ too big", and it started because
someone was saying that they _couldn't_ search he FAQ for answers.

Are you saying that many Windows users don't realize that there is any
way to search through text?

-- 
Andrew Langmead


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

Date: Mon, 26 Jan 1998 14:35:11 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Fed up with CGI.pm
Message-Id: <6ai72e$bqj$1@cyprus.atlantic.net>

According to mfischer@bad.spam.bad.umr.edu (Matt Fischer):
>	I am trying to use CGI.pm (v.2.37010), and attempting to use 
>autoEscape to save some data from a form, but it doesn't seem to work.  I 
>want to save data like ( ), { }, and spaces, however, CGI.pm saves them 
>as % and then their Hex ASCII representation.  

You want the newsgroups next door:
  comp.infosystems.www.authoring.cgi
  comp.lang.perl.modules

-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Mon, 26 Jan 1998 14:21:44 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: Help with opening and copying to a file
Message-Id: <6ai68r$bp6$1@cyprus.atlantic.net>

According to "DianaH" <dhoober@interserv.com>:
>I am new to perl scripting but have been creating internal pages using html,
>perl and cgi scripts for about 5 months now so I do understand a little.  I
>have a project which requires placing information from an internal web page

This is a question for comp.infosystems.www.authoring.cgi.
-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Mon, 26 Jan 1998 13:37:51 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: help: open an existing page and replace parts of it
Message-Id: <ebohlmanEnE8J3.KJM@netcom.com>

Ilia Lobsanov <ilia@detoronics.net> wrote:
: So if the page has something like this:

: <HEAD><TITLE>%%title%%</TITLE></HEAD>

: I want to replace %%title%% with something else.

: Is there a pre-made function that does this?

: Something like
: &f_ReplaceAll (@Array, $html_page);
: where @Array can be an associative array with placeholders and corresponding
: replacements?

Go over to CPAN and look at the text-manipulation modules there.  There 
are a couple that can be cajoled into doing this sort of thing.




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

Date: Sun, 25 Jan 1998 11:01:41 +0800
From: Walter Archie <warchie@att.net.hk>
Subject: Hotmail Script
Message-Id: <34CAAB14.A6EAC7B9@att.net.hk>

Okay... This might be asking a lot. But, I am just wondering if there is
script out there than can do the stuff that hotmail does. I mean like
have folders, send & recieve E-mail. Things like that. But, it runs off
the server's POP3 e-mail not something like MailMan(c) where it gets you
POP3 E-mail from a different server.

Please Help me find one. I do not really need but I'd like to know if it
out there so I do not have take the time make one myself...

Justin Archie



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

Date: Mon, 26 Jan 1998 14:38:22 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: How do you "force" perl to look only in a selected directory for certain files??
Message-Id: <6ai786$brr$1@cyprus.atlantic.net>

According to roberts_d@bms.com:
>I am wondering how you "force" perl code to look only in certain
>directories for code.

    perldoc perlvar	# to learn about @INC
    perldoc lib		# to learn about "use lib"

-- 
Chip Salzenberg               - a.k.a. -                <chip@pobox.com>
           ->  Ask me about Perl training and consulting  <-
                  "We can shower it with neutrons."
              "Or we can do the Neutron Dance!"  // MST3K


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

Date: Sun, 25 Jan 1998 20:10:56 +0000
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Larry's Quotes
Message-Id: <Dg$3PDAQx5y0EwLn@connected.demon.co.uk>

In one_of_my_my_many_Perl_books/Faqs/c.l.p.m/ or somewhere else,
I remember seeing a link to a site with Larry's quotes.

Can't find it now.  Would someone shine the torch ?
-- 
__Jerry Pank_________________________jerryp.usenet@connected.demon.co.uk_

__www.netconnected.com__________________________Just_another_Perl_Hacker_



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

Date: Mon, 26 Jan 1998 06:57:49 -0700
From: "April Kirby" <aprilk@dancris.com>
Subject: Re: Larry's Quotes
Message-Id: <6ai50p$n3$1@usenet50.supernews.com>

Try looking at the site www.perl.org I think it is there.




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

Date: Mon, 26 Jan 1998 11:47:51 +0000
From: kantel@mpiwg-berlin.mpg.de (Jvrg Kantel)
Subject: Re: MacPerl CD-ROM, Version 0.5
Message-Id: <kantel-2601981147510001@demokritos.mpiwg-berlin.mpg.de>

In article <rdm-2301981312030001@140.174.42.30>, rdm@cfcl.com (Rich Morin)
wrote:

> Prime Time Freeware (PTF; http://www.ptf.com) is pleased to announce the
> MacPerl CD-ROM (Version 0.5).  This disc, written in HFS format, includes:
> 
>   *  Version 5.1.9r4 of MacPerl
> 
>   *  PTF's MacPerl Installation and Overview document
> 
>   *  An unpacked and HTML-indexed snapshot of the CPAN
> 
>   *  Additional Perl documentation, from ADVICE Press
> 
>   *  Dozens of technically-oriented Macintosh utilities
> 
> MacPerl, a port of Perl 5, runs under both Mac OS and MPW on Macintosh
> (and clone) systems.  Both M68000 and PowerPC architectures are supported.
> For more information on MacPerl and the MacPerl CD-ROM, visit the MacPerl
> Pages (http://www.ptf.com/macperl).
> 

And is there a Mac Port of the Perl/Tk-Interface in it?

J"org

-- 
J"org Kantel                                   phone: +4930-22667-220
Max Planck Institute for the History of Science  fax: +4930-22667-299
Wilhelmstr. 44                                         D-10117 Berlin
eMail: kantel@mpiwg-berlin.mpg.de
www  : http://www.mpiwg-berlin.mpg.de/staff/kantel/kantel.html


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

Date: Mon, 26 Jan 1998 07:57:31 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: MacPerl CD-ROM, Version 0.5
Message-Id: <pudge-2601980757310001@ppp-5.ts-1.kin.idt.net>

In article <kantel-2601981147510001@demokritos.mpiwg-berlin.mpg.de>,
kantel@mpiwg-berlin.mpg.de (Jvrg Kantel) wrote:

# And is there a Mac Port of the Perl/Tk-Interface in it?

Sigh.  :)  NO, there is no Mac port of Perl/Tk.  The latest:

X-Authentication-Warning: solar.ethz.ch: neeri owned process doing -bs
To: mac-perl@iis.ee.ethz.ch
Subject: Re: [MacPerl] Perl/Tk ? 
Date: Sat, 24 Jan 1998 19:57:45 +0100
From: Matthias Ulrich Neeracher <neeri@iis.ee.ethz.ch>
Sender: owner-mac-perl@iis.ee.ethz.ch
Precedence: bulk

Vincent Nonnenmacher <dpi@pobox.oleane.com> writes:
>Does anyone know here if the Tk 4.2 part of Tcl/Tk thats is running on the
>mac is in par with the one used in the Perl/Tk one ?

The Tk 4.2 port exists, but is fairly unattractive interfacewise (it's 
essentially a straight Motif emulation) and performancewise (same reason).
I'm not going to touch that port (and neither is Sun anymore, I guess).

The Tk 8.0 port is much more interesting, featuring a nice Macish interface
still source compatible with Tk on other platforms. However, AFAIK, there
is no Perl/Tk on an 8.0 level.

>If it is the same who knows if what is the status of the perl part
>regarding the macintosh side.

Not done, and, make no mistake about it, it would be a huge amount of work,
even if there were a Perl/Tk 8.0. Useful though it may be, I see no way
to fit it into my schedule in 1998.

>Doing mac GUI stuff is promising but the Perl?tk answer a more basic x
>platform need and still stay on tha perl side instead of switching to Tcl
>(mainly a syntax war but we are so lazy progamers...).

Everybody agrees that it would be nice to *have* MacPerlTk, but until you find
somebody who thinks it would be nice to *do* MacPerlTk, you're short of luck.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   "I'm set free to find a new illusion" -- Velvet Underground

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Mon, 26 Jan 1998 08:05:02 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: newbie perl programmer requests help (MAC)
Message-Id: <pudge-2601980805020001@ppp-5.ts-1.kin.idt.net>

In article <comdog-ya02408000R2501981844240001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:

# In article <rafiki-2501982304010001@ak183.du.pipex.com>, rafiki@pride.rock 
# posted:
# 
# >Am having trouble getting perl 5 (or any other version) for the mac
# >have checked out CPAN and can not find it there.
# >Am I missing it?
# >Can anyone tell me where to get it?
# 
# go to your favorite CPAN mirror and look in the directory:
# 
#    /CPAN/ports/mac/

Yep, it is always there.  For more information about MacPerl (including
more software and draft chapters of an upcoming book):

   http://ww.ptf.com/macperl/

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Mon, 26 Jan 1998 14:50:19 GMT
From: john.kelly@citicorp.com (john kelly)
Subject: PERL report problem
Message-Id: <34cca281.2320436@news.citicorp.com>

Hi, 
         Could someone please help.
I am having a problem with the report format.
I get the STDOUT_TOP and STDOUT with no problems, but when I try to
write STDOUT_SUMMARY at the end of each category 
(typically at the end of a page, but it could be more then one page) I
get the format and the first data all the time
(it repeats the same data over and over). I tested my code and the
fields contain new data, but I dont get it.  
Can I do this and if so, what am I doing wrong?


I have the following three format statments
------------------------------------------------------------------------------------------
format STDOUT=
  @<<<<<<<<<<<<  @<<<<<<<<<<<< @##  @<<<<<<<<  @<<<<<<<<  @<<<<<<<<<
$host, $orig, $hour, $mean, $mode, $deliv_range
 .
write ;

--------------------------------------------------------------------------------------------
format STDOUT_TOP=


@<<<<<<<<<<<<<<<<<<<<<<<<<<
$TODAY

                                  MIS Report
                            @<<<<<<<< Message Delivery
$category
                               for @<<<<<<<<<<<<<<<<<<<<<
$YESTERDAY

   Host system     Originator  Hour          Delivery times
                                      Mean      Median    95th
Percentile
  -------------  ------------- ---- ---------  ---------
-----------------

 .
write ;

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

$~=STDOUT_SUMMARY ;           # set new format name

format STDOUT_SUMMARY=

                  Summary
                          Average   @<<<<<<<<  @<<<<<<<<  @<<<<<<<<<
@<<<<<<<<
$AVG_mean,$AVG_mode,$AVG_deliv_range
                          Median    @<<<<<<<<  @<<<<<<<<  @<<<<<<<<<
@<<<<<<<<
$MED_mean,$MED_mode,$MED_deliv_range
 .
write ;
$~=STDOUT ;           # restore old format name
----------------------------------------------------------------------------------------------------




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

Date: 26 Jan 1998 11:02:24 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: Problems with DBFile
Message-Id: <6ahqg0$8la$1@pheidippides.axion.bt.co.uk>

[ Posted & Mailed ]

Jonathan Nicholson (jono@nospam.nowhere.noorg) wrote:
: I did try to reply to this via email, but it bounced....

Sould work now. We had a few problems at this end.

: Since I wrote this I've made a few changes to the code, that seem to have
: fixed the symptoms, but I don't understand quite why, I've changed the way
: the data is packed from strings, from using null padding to using space
: padding. 

: ----

: Here's the extra information:-

: At the moment I've taken steps to ensure that there is only one access to
: the database at a time (by not running multiple instances of the program)
: the locking proceedures I've been using are as follows (these do not work
: currently due to an unrelated Digital Problem)

: On opening the DB I clone the file handle as follows:-


: $outputdb = tie(%datatie, "DB_File", $MASTER_DB, O_RDWR|O_CREAT, 
: 			0640,  $DB_HASH) 
: 		|| die "Failed to open file $MASTER_DB for write : $!\n";
: $fd = $outputdb->fd;
: open(FH, "+<&=$fd") || die "FAILED: fdopen $!\n";

: Then whenever I use the database I call a subroutine:-

: 	&dolock(&F_RDLCK);
: 	%thisproj = &dounpack($datatie{$instance});
: 	&dolock(&F_UNLCK);

: where dolock is defined:-


: sub dolock {
: 	local ($mode) = @_;
: 	local ($flock);
: 	$flock = pack('iilli', $mode, 0, 0, 0, $$);
: 	fcntl(FH, &F_SETLKW, $flock);
: }

: Not pretty, but it works.

Locking isn't one of my hot topics, but I do have mail from Keith
Bostic (the author of Berkeley DB), where he says that DB 1.85 is
really not usable in a multiple reader/writer environment without a lot
of work.

The good news is that locking works properly (and completely behind the
scenes) in DB 2.x. An alpha of my rewrite for DB_File, called
BerkeleyDB, which uses DB 2.x is available on CPAN

: The code that exhibits the problems with creating keys follows. It's
: not very well commented! The dopack routine that is commented out is
: included from the Sinbad::Sinbad module.

Sorry I can't see anything wrong with your code. Could you to create a
self-contained script that exibited the problem?

[ code deleted]

: DB_File is version 1.14

: As the the version of the Berkley DB I can only guess, it was installed
: with the operating system and no documentation is with it... The
: include file (db.h) has a verion 8.7 at the top, which is the only version
: number I can find... I don't know whether that is a Digital revision or
: not

That is db 1.85

You could try upgrading to db.1.86. It did fix a few bugs that may be
what you are experiencing. The only gotcha is that the database file
format changed in 1.86.

Paul


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

Date: 26 Jan 1998 09:47:50 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: questions about *DB* usage
Message-Id: <6ahm46$4qb$1@pheidippides.axion.bt.co.uk>

[ Posted & Mailed ]

Bob Berman (rjberman@mindspring.com) wrote:
: These are probably real embarrasing newbie type questions,
: but I can't find any examples anywhere, so I thank anyone
: who answers in advance!!

: 1) When I use DB_File and do:

: use DB_File;
: $key = "Bob";
: $value = 200;

: $X = DB_File::TIEHASH(DB_File, "xxx", O_RDWR|O_CREAT, 0666);
: $status = $X->put($key, $value);
: untie %X;

The correct way to open a database with DB_File is:

    tie %X, "DB_File", "xxx", O_RDWR|O_CREAT, 0666, $DB_HASH
	or die "Cannot open file: $!\n" ;

The low-level "put" method is only necessary if you want fine control
over what you are doing. The vast majority of the time

    $X{$key} = $value ;

and

    $value = $X{$key}

are all that is required.

See the documentation included in the file DB_File.pm for more details.

: a file named "xxx" is created. Why isn't xxx.dir or xxx.pag created?
: I thought DB_File created files with those names?

Berkeley DB, which is the database library that DB_File uses, doesn't
need to create .dir & .pag files. It stores everything it needs in one
file. Only the older DBM implementations create .dir & .pag files.

: 2) How do I use GDBM? I have GDBM installed and if I do:

: use GDBM_File;

: $key = "Bob";
: $value = 200;

: $X = GDBM_File::TIEHASH(GDBM_File, "xxx", O_RDWR|O_CREAT, 0640);
: $X{$key} = $value;
: untie %X;

: it too creates a file named "xxx", although slightly smaller than with
: DB_File above. But how do I store data in it? The GDBM_File documentation
: says to look at the gdbm(3) man page, which I did. That mentions routines
: such as "store", but how do I use them from Perl? If I insert a line like:


: $status = $X->store($key, $value);

: before I untie the hash, I get an error:
: Can't locate auto/GDBM_File/store.al in @INC

The correct way to open a database with GDBM_File is:

    tie %X, "GDBM_File", "xxx", O_RDWR|O_CREAT, 0666
	or die "Cannot open file: $!\n" ;

As with DB_File, you read/write to the database like this:

    $X{$key} = $value ;
    $value = $X{$key}

: 3) What's the story with NEWDB? (db.1.85.tar.gz from
: www.sleepycat.com). When I installed sendmail, the README
: implied that this was superior to ndbm, I think. But it
: warned about installing a header file in the db.1.85 distribution
: and to remove a module from the .a library. Does Perl support
: NEWDB or should I avoid it? Maybe this is ndbm above?

db.1.85 is Berkeley DB, the library that DB_File uses.

: What am I doing wrong?

Not reading the documentation perhaps :-)

Paul


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

Date: Mon, 26 Jan 1998 01:22:49 GMT
From: r.breman@student.utwente.nl
Subject: search script for perl win'95
Message-Id: <1103_885777769@dgf.student.utwente.nl>

Hi,

I'am looking for a good search script for perl under win'95
I know I should run linux/unix, i did but now I'am stuck with win'95 because
I have to use it (ordered by my school).
Finally i got my web-site running and got some scripts up.
But.... win'95 isn't linux ......
I've found several good scripts for linux but none good for win'95
The script has to search directories recursively, ..... is there any ?

If anyone can help me out with a search script for win'95 please e-mail it.


Thanx, Robin



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

Date: Mon, 26 Jan 1998 10:32:58 +0100
From: "Bildbau" <welcome@bildbau.de>
Subject: User Adminstration with Win32::netadmin
Message-Id: <34cc593a.1@news.sireco.de>

I work with Windows NT 4.0 and MS Peer Web Server.

I want create FTP-Accounts with User -ID and Password for virtuell
directories in a domain automatically with a perl script. To do this I have
to adminstrate Users and Users groups in the user manager.
It ist possible to manage them via a perl script. I know it exist a modul
named win32::netadmin from the CPAN, but I don4t know how i handle it.

For notes or tips in the right direction I was very lucky

Thanks Hagen

Berlin, Germany

hagen@bildbau.de






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

Date: Mon, 26 Jan 1998 12:21:10 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: White Hats and Black
Message-Id: <Pine.A41.3.95a.980126115420.81126C-100000@sp052>

On 26 Jan 1998, Tom Christiansen wrote:

> In comp.lang.perl.misc, "Alan J. Flavell" <flavell@mail.cern.ch> writes:
> :> How many times are you going to post this? I've seen three so far.

No, I didn't say that, I commented on it.

> I cancelled a mistaken post and reposted.  I should have
> used supersede, I guess.  And I didn't care to use a crosspost
> to a moderated group I've had trouble getting messages through to.

Well, dejanews seems to think you posted it seven times, separately to 
five groups.

> But I cannot see how anyone could say the freeing of
> course as a bad thing.  You're not saying it is, are you?

Not as a principle, no.  We'll have to see how it works out in practice. 





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

Date: Mon, 26 Jan 1998 08:01:01 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: White Hats and Black
Message-Id: <pudge-2601980801010001@ppp-5.ts-1.kin.idt.net>

In article <Pine.A41.3.95a.980126115420.81126C-100000@sp052>, "Alan J.
Flavell" <flavell@mail.cern.ch> wrote:

# > I cancelled a mistaken post and reposted.  I should have
# > used supersede, I guess.  And I didn't care to use a crosspost
# > to a moderated group I've had trouble getting messages through to.
# 
# Well, dejanews seems to think you posted it seven times, separately to 
# five groups.

  get
--------
yourself

--
Chris Nandor               pudge@pobox.com           http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==                    MacPerl: Power and Ease                     ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

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 1730
**************************************

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