[10302] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3895 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 5 17:07:33 1998

Date: Mon, 5 Oct 98 14:00:20 -0700
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, 5 Oct 1998     Volume: 8 Number: 3895

Today's topics:
    Re: $/ in 5.005 (Ilya Zakharevich)
    Re: Add user script <eashton@bbnplanet.com>
    Re: Add user script <tytek@yahoo.com>
    Re: Common prefix for an array of strings <Paul.Makepeace@POBox.com>
    Re: Common prefix for an array of strings (Abigail)
        Copying JPG file - a solution <info@edoc.co.za>
        Data Search Question (Garrett Casey)
        display perldoc in emacs <xah@best.com>
        Help with mutilple HTML lines <gala@sonic.net>
    Re: implementing ceiling and floor (John Klassa)
    Re: implementing ceiling and floor <xah@best.com>
        Internet Programmer Wanted project3@my-dejanews.com
        ms access databases <klaus.reiger@fantasie.com>
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: new term for illogical <sauvin@osmic.com>
    Re: POLL: Perl features springing into your face (Peter Scott)
    Re: POLL: Perl features springing into your face (Ilya Zakharevich)
    Re: Search for forwardslash...how? (Larry Rosler)
        Sequential numbering of submitted forms cmaher@my-dejanews.com
        sequential tracking numbers chris@1x.com
    Re: Solution found! <sauvin@osmic.com>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        subroutine problem <hamptonk@bible.org>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 5 Oct 1998 20:42:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: $/ in 5.005
Message-Id: <6vbavh$f0e$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Hr. Jochen Stenzel
<Jochen.Stenzel.gp@icn.siemens.de>],
who wrote in article <3618EE9D.B40EAA70@icn.siemens.de>:
> 
> Unfortunately, I WANT to use threads ...

People who WANT to use threads are supposed to be fluent with editors
and `diff'.  In other words: patch welcome!

Hope this helps,
Ilya


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

Date: Mon, 05 Oct 1998 19:13:06 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Add user script
Message-Id: <361917CA.62D181E0@bbnplanet.com>

Ty Goolman wrote:

> I am in search of an add user script.  I am running Apache/1.2.6
> FrontPage/3.0.3 on a RH Linux server.  I  would like to automate adding new
> users to my server. I would prefer using a Perl script(s).

Well, with FrontPage users can make their own account on the machine. :)
What are you adding users to, FP or the system? You might have a go at
sunsite, I remember there being a script for system accounts which you
could use as an example.

e.

And did you get what you wanted from this life,
even so? I did.  And what did you want?
To call myself beloved, to feel myself
beloved on the earth.               -R. Carver-


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

Date: Mon, 5 Oct 1998 15:42:03 -0400
From: "Ty Goolman" <tytek@yahoo.com>
Subject: Re: Add user script
Message-Id: <6vb8b4$dku@nntp1.erinet.com>

Elaine -HappyFunBall- Ashton wrote in message
<361917CA.62D181E0@bbnplanet.com>...
>Ty Goolman wrote:
>
>> I am in search of an add user script.  I am running Apache/1.2.6
>> FrontPage/3.0.3 on a RH Linux server.  I  would like to automate adding
new
>> users to my server. I would prefer using a Perl script(s).
>
>Well, with FrontPage users can make their own account on the machine. :)
>What are you adding users to, FP or the system? You might have a go at
>sunsite, I remember there being a script for system accounts which you
>could use as an example.


I've looked everywhere except Sunsite, I'll go right now and look there. You
don't happen to remember the name of it?

I am adding users to the system, and optionally giving them FP extensions.

Ty Goolman
Tytek Network Solutions - http://www.tytek.net
Tytek Computers - http://www.tytek.com
Win $$$, Prizes. Get Free Stuff - http://www.winonthe.net
Muscle Car Mania - http://muscle.tytek.net




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

Date: Mon, 5 Oct 1998 18:32:25 +0100
From: "Paul Makepeace" <Paul.Makepeace@POBox.com>
Subject: Re: Common prefix for an array of strings
Message-Id: <6vb5qr$k8u$1@statler.server.colt.net>

[posted & mailed to author]

-----Original Message-----
From: Bart Lateur <bart.mediamind@ping.be>


>Here's a nice puzzle for you. How do you extract a common prefix of a
>number of strings? The solution I have doesn't appeal to me. It's much
>too like C. There must be better solutions.


This hack seems to work. The logic of the problem allows you to chop back
any element of the list until it fits with the any other one.

I envisaged another solution, packing it into a chunk of data and bitwise
ANDing the two together for the comparison and doing some %n bit-count
(oops: Unicode). Why bother with C, let's just go Assembler ;-)

#!/usr/local/bin/perl

@strings = qw(
        relocations
        reluctance
        reluctant
        reluctantly
        rely
        relying
);

$min = pop @strings;
foreach (@strings) {
        until (/$min/) {
                $min = substr $min, 0, (length $min)-1;
        }
}

print "Common prefix is '$min'.\n";


paul$ perl -w play.pl
Common prefix is 'rel'.
paul$




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

Date: 5 Oct 1998 20:49:38 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Common prefix for an array of strings
Message-Id: <6vbbd2$b9l$1@client3.news.psi.net>

Bart Lateur (bart.mediamind@ping.be) wrote on MDCCCLXI September MCMXCIII
in <URL:news:3618bc9b.2349307@news.ping.be>:
++ Here's a nice puzzle for you. How do you extract a common prefix of a
++ number of strings? The solution I have doesn't appeal to me. It's much
++ too like C. There must be better solutions.

This was discussed lengthly a few months ago in this group.

You might want to use Dejanews; the thread was quite interesting.



Abigail
-- 
undef$/;$_=<DATA>;s.\n..g,%%=map{$i++=>$_}split//=>"Y|\\<>/,";s,9(..)|8(
 .)|7(.),($1||$2?" ":_)x($1||$2||$3||10),xeg,s,.,$%{$&}||$&,xeg,s,(.{54})
,$1\n,xg,print
__DATA__
915749177293018418172817282775821719281841182182258273528372292352721841
182182527381282182192527811745574824811721946259467284729217585748474817
158217181182172847481778227282283584282582718122837221821822817158172812
271827281282581728127118318223823714814182182183082228273582182125813748
251731825812745811721821731825812738248117218825862592025862591970917729
252768328274817781182192518573571581728122718272812182192518418428273582
182125182172923174185273824811721821745938259327381739197292558318328175
857482182181728274817786589227282282715817328118215815715817281227182728
128528408458158172812712822738118438128273582182125862731718258137482581
2738241721718128127382481172191425872586258625852589


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

Date: Mon, 05 Oct 1998 08:45:06 +0200
From: Nico <info@edoc.co.za>
Subject: Copying JPG file - a solution
Message-Id: <36186AF2.19FF@edoc.co.za>

I had an problem in copying a jpg file with PERL.

Thanks to all that responded.

The key to the problem is WIN95.  If you read the documentation in
perldoc -f binmode, you will see that DOS nad ohter "archaic" operating
systems handles text and Binaryfiles in different ways, unlike UNIX. 
Thefore you need to add the binmode(FILEHANDLE) at times.

A solution: (The one that worked easiest for me)

#Snippet to copy non-text files in Win95
#
#Newbie Licence:  You are free to use this snippet as long 
#as you remember to be kind to newbies and their stupid problems
#
#This snippet is guarenteed only to have worked om my PC.
#No other guarentees or support provided


#Read file
open (JPGFILE,$jpgfilesource) || die "x4 can not open  $jpgfilesource";
open (JPGFILE2,">$jpgfilecopy") || die "x5 can not open $jpgfilecopy";

binmode ( JPGFILE );
binmode ( JPGFILE2 );

while (<JPGFILE>)
{
    print JPGFILE2;
}


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

Date: Mon, 05 Oct 1998 20:29:29 GMT
From: nospamno_adms1@cts.com (Garrett Casey)
Subject: Data Search Question
Message-Id: <36192956.269950618@nntp.cts.com>

Here is the sinerio...

I have 1,000,000 character strings that are 10 random A-Z characters
in length. For example:

JSUWIGKROD
KIWPLODGQF
WOQPLIFJSK
OQPALSNEUG
ISOPQKEOSP
etc... 

A user inputs his own 10 character A-Z string:

UQPALRIEOF

And the program returns the closest match.  The match, though, must be
based on PER CHARACTER comparision - not the string as a whole.

For instance,

UQPALRIEOF would match UQPALRIDOF 90% because 9 out of the 10
characters are the same.

In your opinion, what is the most efficient data structure I can use
to store the 1,000,000 strings, and the most efficient way to search
for such a comparison in that data structure?




Garrett Casey
nospamo_adms1@cts.com
Remove "nospamo_" To send me email.


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

Date: Mon, 05 Oct 1998 12:42:40 +0000
From: "Xah" <xah@best.com>
Subject: display perldoc in emacs
Message-Id: <6vb6v9$jn1$1@nntp2.ba.best.com>

Rather an emacs question. In emacs, when I do

"M-! perldoc perl"

I get a rather ugly text with control characters. I can remedy it by using
the plain text conversion option

"M-! perldoc -t perl"

but I like the bold faces etc. What can I do?

(I'm using Xemacs through telnet)

 Xah, xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 >They fight! They bite! They fight and bite and fight!
 >Fight fight fight! Bite bite bite!
 >The Itchy and Scratchy Show!


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

Date: Mon, 5 Oct 1998 13:57:43 -0700
From: "Gala Grant" <gala@sonic.net>
Subject: Help with mutilple HTML lines
Message-Id: <6vb8br$u2d$1@ultra.sonic.net>

I am trying to write a perl program that among other things searchs an HTML
file for a text match.  The problem I am having is that what HTML and perl
think is a line is different.  So what I am searching for spreads over 2
lines in HTML, so when I do
        if ($line = /$match/)
it won't match.  I tried removing theline delimiter, but that created a
whole new buch of problems.  If anyone can help it would be greatly
appreciated.
Gala Grant
gala@sonic.net




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

Date: 5 Oct 1998 19:14:22 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: implementing ceiling and floor
Message-Id: <6vb5qe$nc2$1@aurwww.aur.alcatel.com>

On Sun, 04 Oct 1998 12:33:20 +0000, Xah <xah@best.com> wrote:
  > I'm implementing "ceiling" and "floor", since I don't see them anywhere
  > and the FAQ basically says implement your own.

Which version of the FAQ are you reading (seriously)?  Mine says:

    The POSIX module (part of the standard perl distribution) implements
    ceil(), floor(), and a number of other mathematical and trigonometric
    functions.

I just whipped up a test case to make sure:

    use POSIX;
 
    $i = 1.1;
    print "ceil is ", ceil($i), "\n";
    print "floor is ", floor($i), "\n";
  
    $i = -1.1;
    print "ceil is ", ceil($i), "\n";
    print "floor is ", floor($i), "\n";

and got the expected:

    ceil is 2
    floor is 1
    ceil is -1
    floor is -2

 ...or am I missing something?

(On a side note, Xah, are you yet finding perl to be useful and powerful,
or are you still decidedly in the anti-perl camp?  I'm genuinely curious.
I haven't talked to you in a while.)

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


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

Date: Mon, 05 Oct 1998 13:41:31 +0000
From: "Xah" <xah@best.com>
Subject: Re: implementing ceiling and floor
Message-Id: <6vbadl$kpk$1@nntp2.ba.best.com>

I wrote:
> I'm implementing "ceiling" and "floor", since I don't see them anywhere
> and the FAQ basically says implement your own.

My apologies to the mailing list. This is fairly careless question. Yes, the
FAQ said they are in POSIX module (my careless reading), and (int($a) == $a)
will tell me if $a is an integer.

Thanks to all.

 Xah, xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 >They love, they share! They love and share and care!
 >Love and share! Share and care!
 >The Itchy and Scratchy Show!


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

Date: Mon, 05 Oct 1998 20:11:35 GMT
From: project3@my-dejanews.com
Subject: Internet Programmer Wanted
Message-Id: <6vb95n$mcc$1@nnrp1.dejanews.com>

Internet commerce company in the Boston, MA area seeks technical developers:
Unix, Perl, CGI, HTML, SQL. Windows NT, IIS, and ASP are pluses. E-mail resume
and salary requirements to resume@odc.com.

Thanks!

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 5 Oct 1998 22:34:08 +0200
From: "Klaus Reiger" <klaus.reiger@fantasie.com>
Subject: ms access databases
Message-Id: <36192da8.0@news.extension.net>

does anyone have experiences with perl and ms access databases ?
thank you for answering.

Klaus.Reiger@tic-tac-toe.com





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

Date: 5 Oct 1998 19:11:44 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <6vb5lg$305$4@info.uah.edu>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 28 Sep 1998 18:52:58 GMT and ending at
05 Oct 1998 08:07:17 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 1998 Greg Bacon.  All Rights Reserved.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Totals
======

Posters:  245 (48.2% of all posters)
Articles: 333 (26.3% of all articles)
Volume generated: 515.4 kb (24.7% of total volume)
    - headers:    224.1 kb (4,674 lines)
    - bodies:     285.1 kb (9,888 lines)
    - original:   226.4 kb (8,069 lines)
    - signatures: 5.9 kb (122 lines)

Original Content Rating: 0.794

Averages
========

Posts per poster: 1.4
    median: 1 post
    mode:   1 post - 193 posters
    s:      0.9 posts
Message size: 1585.0 bytes
    - header:     689.1 bytes (14.0 lines)
    - body:       876.6 bytes (29.7 lines)
    - original:   696.2 bytes (24.2 lines)
    - signature:  18.3 bytes (0.4 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

    5     6.4 (  3.6/  2.7/  1.3)  "Roberto Cerini" <rob@ccsn.com>
    5    11.1 (  3.1/  7.9/  4.8)  "Joe Williams" <williams@clark.net>
    5     8.0 (  3.5/  4.4/  3.2)  dwatanab@uci.edu
    5     7.2 (  4.3/  2.9/  1.7)  Ben Duncan <ben@isolve.net>
    4     5.7 (  2.8/  2.9/  0.4)  Hongwei <howel88@cyberway.com.sg>
    4     5.7 (  3.2/  2.5/  1.8)  sergio@mail.pt
    4     8.0 (  2.6/  5.4/  2.0)  shambop@bacon-and-spam.timeoutny.com (Shambo Pfaff)
    4     4.2 (  2.4/  1.8/  1.8)  "brettr" <brettr@centuryinter.net>
    4     6.1 (  2.3/  3.7/  3.4)  rfbarham@flash.net (Richard F. Barham)
    4     6.1 (  2.6/  3.5/  2.2)  "Daniel Vesma" <daniel.vesma@thewebtree.com>

These posters accounted for 3.5% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  11.1 (  3.1/  7.9/  4.8)      5  "Joe Williams" <williams@clark.net>
   9.0 (  0.6/  8.5/  7.7)      1  Rick Payne <rickp@connect.ab.ca>
   8.7 (  0.9/  7.7/  7.6)      1  scott@mtnlake.com
   8.0 (  1.0/  6.9/  6.6)      1  "Jeffrey L. Taylor" <jltaylo@sandia.gov>
   8.0 (  3.5/  4.4/  3.2)      5  dwatanab@uci.edu
   8.0 (  2.6/  5.4/  2.0)      4  shambop@bacon-and-spam.timeoutny.com (Shambo Pfaff)
   7.2 (  4.3/  2.9/  1.7)      5  Ben Duncan <ben@isolve.net>
   6.8 (  2.3/  4.5/  1.9)      3  steveg@nospam.org (Steve maZe)
   6.6 (  1.4/  5.3/  4.6)      2  vwstranathan <vwstranathan@home.net>
   6.5 (  2.2/  4.3/  4.0)      3  "Computer Guru" <computerguru@mailexcite.com>

These posters accounted for 3.8% of the total volume.

Top 10 Posters by OCR (minimum of three posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

1.000  (  2.7 /  2.7)      3  rgee@telecom.com
1.000  (  1.8 /  1.8)      4  "brettr" <brettr@centuryinter.net>
0.984  (  3.6 /  3.7)      4  grueni@stuttgart.netsurf.de (Andreas Grueninger)
0.955  (  1.0 /  1.0)      3  "Brian Moulton" <webmaster@cbsa.ca>
0.935  (  1.6 /  1.7)      3  "Perless Dudek" <perless@yellowkite.com>
0.929  (  4.0 /  4.3)      3  "Computer Guru" <computerguru@mailexcite.com>
0.909  (  3.4 /  3.7)      4  rfbarham@flash.net (Richard F. Barham)
0.778  (  0.8 /  1.1)      3  info@edoc.co.za
0.752  (  3.2 /  4.2)      3  "Craig Bandon" <cbandon_nospam@tiac.net>
0.712  (  3.2 /  4.4)      5  dwatanab@uci.edu

Bottom 10 Posters by OCR (minimum of three posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.617  (  2.2 /  3.5)      4  "Daniel Vesma" <daniel.vesma@thewebtree.com>
0.605  (  4.8 /  7.9)      5  "Joe Williams" <williams@clark.net>
0.593  (  1.7 /  2.9)      5  Ben Duncan <ben@isolve.net>
0.559  (  1.4 /  2.5)      3  mwwenzel@my-dejanews.com
0.477  (  1.3 /  2.7)      5  "Roberto Cerini" <rob@ccsn.com>
0.466  (  0.9 /  2.0)      3  smaring@gte-es.com
0.423  (  1.9 /  4.5)      3  steveg@nospam.org (Steve maZe)
0.378  (  2.0 /  5.4)      4  shambop@bacon-and-spam.timeoutny.com (Shambo Pfaff)
0.275  (  0.2 /  0.6)      3  minolta@psu.edu
0.133  (  0.4 /  2.9)      4  Hongwei <howel88@cyberway.com.sg>

21 posters (8%) had at least three posts.


Top 10 Crossposters
===================

Articles  Address
--------  -------

       9  JP@somehost.somedomain (JP)
       6  "Jeffrey L. Taylor" <jltaylo@sandia.gov>
       4  scott@mtnlake.com
       3  joost@dt.net
       2  teds@intex.com
       2  Chris Thompson <ct@NOSPAMcthompson.org>
       2  freeweb <jml@hotmail.com>
       2  afs@sadera.com
       2  Dan Bialek <dan.bialek@mindspring.com>
       2  catnip8@geocities.com (catnip)


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

Date: Mon, 05 Oct 1998 15:06:56 -0400
From: Ben Sauvin <sauvin@osmic.com>
Subject: Re: new term for illogical
Message-Id: <361918CF.BACA4296@osmic.com>

    Dunno about abrasiveness being any reliable indication of insecurity or
sensitivity. Some people are abrasive simply because they don't give a damn.

Elaine -HappyFunBall- Ashton wrote:

> Scratchie wrote:
>
> > : poor abby couldn't handle some acerbic comments back at he/r!
> >
> > She's the sensitive type, you know.
>
> The more abrasive you are the more insecure and sensitive you are...as a
> general rule of thumb.
>
> e.
>
> Would I live my life over again?
> Make the same unforgivable mistakes?
> Yes, given half a chance. Yes  -R. Carver-



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

Date: 5 Oct 1998 16:57:51 GMT
From: psl@euclid.jpl.nasa.gov (Peter Scott)
Subject: Re: POLL: Perl features springing into your face
Message-Id: <6vatqf$608@netline.jpl.nasa.gov>

> While we're talking about pet peeves, I'd also add:
> 
>     barewords - if you want a quoted string, for gosh sakes put $#@!
>     quotes around it!

But it's so nice to use them as hash keys and on the left of => ...

How about this: since programs that use barewords tend to have a fairly
small set of them, what about an optional preclararion pragma a la use vars:

use barewords qw(-text -code name job salary title);

presumably in combination with some pragma which would outlaw all other
barewords...

-- 
This is news.  This is your      |  Peter Scott, NASA/JPL/Caltech
brain on news.  Any questions?   |  (psl@euclid.jpl.nasa.gov)

Disclaimer:  These comments are the personal opinions of the author, and 
have not been adopted, authorized, ratified, or approved by JPL.


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

Date: 5 Oct 1998 20:36:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: POLL: Perl features springing into your face
Message-Id: <6vbak0$ejg$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Peter Scott
<psl@euclid.jpl.nasa.gov>],
who wrote in article <6vatqf$608@netline.jpl.nasa.gov>:
> > While we're talking about pet peeves, I'd also add:
> > 
> >     barewords - if you want a quoted string, for gosh sakes put $#@!
> >     quotes around it!
> 
> But it's so nice to use them as hash keys and on the left of => ...

As Larry already noted in this thread, they are *not* barewords when
appear in these positions.  They are quoted, period.

Ilya


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

Date: Mon, 5 Oct 1998 12:54:54 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Search for forwardslash...how?
Message-Id: <MPG.1082c3e91bbeef269897df@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <36190F91.EA002409@min.net> on Mon, 05 Oct 1998 14:27:29 -
0400, John Porter <jdporter@min.net> says...
 ...
> If you just want to replace the slashes with spaces,
> 
> s#/# #g;

Just as TomC says words such as 'is in' or 'exists' should cause a 
mindleap to 'hash', this locution ('globally substitute one character 
with another') should cause a mindleap to 'tr'.  It's much faster.

  tr#/# #;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 05 Oct 1998 20:07:59 GMT
From: cmaher@my-dejanews.com
Subject: Sequential numbering of submitted forms
Message-Id: <6vb8uu$m85$1@nnrp1.dejanews.com>

I have a client that would like to have forms submitted from their web site
that have sequential tracking numbers. I can easily create the forms that
will post the data that they want, but how can I increment and post a number
with each submitted form?

Thanks for you help,

Chris

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Mon, 05 Oct 1998 20:16:52 GMT
From: chris@1x.com
Subject: sequential tracking numbers
Message-Id: <6vb9fj$n18$1@nnrp1.dejanews.com>

I have a client that would like forms submitted from their web site to have
sequential tracking numbers. I can easily create the forms that will post the
data that they want, but how can I increment and post a unique number with
each submitted form?

Thanks for your help,

Chris

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 05 Oct 1998 15:15:46 -0400
From: Ben Sauvin <sauvin@osmic.com>
Subject: Re: Solution found!
Message-Id: <36191AE2.17443F0F@osmic.com>

    Don't be so damn byzantine! Just shove a Matt script up the tailpipe - next
time the neighbor starts the car, the backpressure will take care of the motor,
which will mean having to move the car to /dev/null for the forseeable future.

Ethan H. Poole wrote:

> [Posted and Emailed]  In article <3615422B.FAC0A27@bbnplanet.com>,
> eashton@bbnplanet.com says...
> >
> >Eric Von Zee wrote:
> >
> >> sub 12gauge_shotgun {
> >> $planet =~ s/neighbor//;
> >> } #end sub 12gauge_shotgun
> >
> >No, too violent. I'm a kind-hearted soul who just wants some sleep.
> >
> >Perl is going to help with this solution though :) A pilot with perl, a
> >bit of sophisticated military tech from work and a radio to blast Celine
> >Dion singing that damned Titanic song. I may start wretching but it
> >should get the message across. If not, there is always the monster tesla
> >coil that will have the mechanics scratching their heads. *mwaahaahaa*
> >God I love working with engineers.
>
> A 12-gauge shotgun is too violent, but a well directed missile isn't?
> <chuckle>
>
> How about a high energy microwave pulse -- it has much greater range than a
> tesla coil and should equally confuse the mechanics.
>
> --
> Ethan H. Poole            | Website Design and Hosting,
>                           | CGI Programming (Perl & C)..
> ========Personal========= | ============================
> * ehp @ gte . net *       | --Interact2Day--
> http://home1.gte.net/ehp/ | http://www.interact2day.com/



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

Date: 5 Oct 1998 19:11:25 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <6vb5kt$305$3@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 28 Sep 1998 18:52:58 GMT and ending at
05 Oct 1998 08:07:17 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" email address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Find the News-Scan distribution on the CPAN!
      <URL:http://www.perl.com/CPAN/modules/by-module/News/>
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
    - Copyright (c) 1998 Greg Bacon.  All Rights Reserved.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Excluded Posters
================

perlfaq-suggestions\@mox\.perl\.com

Totals
======

Posters:  508
Articles: 1264 (501 with cutlined signatures)
Threads:  412
Volume generated: 2090.3 kb
    - headers:    889.0 kb (18,152 lines)
    - bodies:     1115.0 kb (36,572 lines)
    - original:   756.4 kb (26,804 lines)
    - signatures: 85.1 kb (1,745 lines)

Original Content Rating: 0.678

Averages
========

Posts per poster: 2.5
    median: 1.0 post
    mode:   1 post - 326 posters
    s:      5.0 posts
Posts per thread: 3.1
    median: 2.0 posts
    mode:   1 post - 132 threads
    s:      3.3 posts
Message size: 1693.4 bytes
    - header:     720.2 bytes (14.4 lines)
    - body:       903.3 bytes (28.9 lines)
    - original:   612.8 bytes (21.2 lines)
    - signature:  68.9 bytes (1.4 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   56    90.2 ( 36.7/ 46.2/ 24.6)  Jonathan Stowe <gellyfish@btinternet.com>
   44    70.8 ( 38.7/ 32.1/ 23.6)  "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
   39    62.0 ( 24.5/ 33.0/ 19.8)  lr@hpl.hp.com (Larry Rosler)
   38    64.0 ( 33.3/ 28.2/ 16.8)  John Porter <jdporter@min.net>
   25    40.6 ( 14.7/ 22.0/  9.7)  Uri Guttman <uri@camel.fastserv.com>
   25    42.1 ( 19.9/ 22.2/ 11.3)  Michal Rutka <erhmiru@erh.ericsson.se>
   18    38.5 ( 13.8/ 18.6/ 13.2)  abigail@fnx.com
   18    29.6 ( 14.5/ 10.5/  4.7)  rjk@coos.dartmouth.edu (Ronald J Kimball)
   17    24.8 ( 12.6/  7.8/  4.2)  comdog@computerdog.com (brian d foy)
   16    25.1 (  9.2/ 15.8/ 10.1)  tadmc@flash.net (Tad McClellan)

These posters accounted for 23.4% of all articles.

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  90.2 ( 36.7/ 46.2/ 24.6)     56  Jonathan Stowe <gellyfish@btinternet.com>
  70.8 ( 38.7/ 32.1/ 23.6)     44  "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
  64.0 ( 33.3/ 28.2/ 16.8)     38  John Porter <jdporter@min.net>
  62.0 ( 24.5/ 33.0/ 19.8)     39  lr@hpl.hp.com (Larry Rosler)
  55.2 ( 10.5/ 44.7/ 36.5)     16  "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
  42.1 ( 19.9/ 22.2/ 11.3)     25  Michal Rutka <erhmiru@erh.ericsson.se>
  40.6 ( 14.7/ 22.0/  9.7)     25  Uri Guttman <uri@camel.fastserv.com>
  38.5 ( 13.8/ 18.6/ 13.2)     18  abigail@fnx.com
  29.8 ( 12.8/ 17.0/ 10.6)     16  droby@copyright.com
  29.6 ( 14.5/ 10.5/  4.7)     18  rjk@coos.dartmouth.edu (Ronald J Kimball)

These posters accounted for 25.0% of the total volume.

Top 10 Posters by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.957  (  2.9 /  3.0)      5  fl_aggie@thepentagon.com (I R A Aggie)
0.877  (  9.2 / 10.5)      7  tchrist@mox.perl.com (Tom Christiansen)
0.875  ( 10.8 / 12.4)      5  sb@engelschall.com (Steffen Beyer)
0.816  ( 36.5 / 44.7)     16  "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
0.786  (  1.6 /  2.0)      5  daniel@intecomp.com (Daniel Pray)
0.740  (  7.2 /  9.7)     15  mjd@op.net (Mark-Jason Dominus)
0.736  ( 23.6 / 32.1)     44  "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
0.726  (  3.1 /  4.2)      5  bill@fccj.org
0.714  (  4.1 /  5.8)      6  ptimmins@netserv.unmc.edu (Patrick Timmins)
0.712  (  3.2 /  4.4)      5  dwatanab@uci.edu

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Address
-----  --------------  -----  -------

0.456  (  1.9 /  4.2)      5  ehp@gte.net (Ethan H. Poole)
0.455  (  5.5 / 12.1)     14  dblack@saturn.superlink.net (David A. Black)
0.450  (  3.1 /  6.9)      7  larry@kiev.wall.org (Larry Wall)
0.448  (  3.5 /  7.8)      6  bhilton@tsg.adc.com (Brand Hilton)
0.444  (  4.7 / 10.5)     18  rjk@coos.dartmouth.edu (Ronald J Kimball)
0.440  (  9.7 / 22.0)     25  Uri Guttman <uri@camel.fastserv.com>
0.419  (  2.9 /  7.0)      5  "Phinneas G. Stone" <phinneas@eskimo.com>
0.410  (  1.8 /  4.5)      6  phenix@interpath.com (John Moreno)
0.379  (  1.5 /  3.9)      5  Matt Pryor <matt@whiterabbit.co.uk>
0.370  (  1.3 /  3.5)      5  jwl@_munged_worldmusic.de (Joergen W. Lang)

48 posters (9%) had at least five posts.

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   35  Need IP Address Sort Subroutine
   20  need a regular expressions expert....
   18  Alternate colors in tables with perl command?
   16  new term for illogical
   14  CGI.pm - forms within tables - How to?
   14  Perl as solution?
   13  How do I remove a carriage return or space from a string?
   12  SRC: encrypt your Perl scripts! :-)
   12  string from array
   11  DEL in PERL

These threads accounted for 13.1% of all articles.

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  67.5 ( 29.0/ 36.6/ 21.1)     35  Need IP Address Sort Subroutine
  38.0 (  2.1/ 35.6/ 35.1)      3  determine an IP
  31.8 ( 13.7/ 15.8/  7.0)     20  need a regular expressions expert....
  27.6 ( 14.4/ 11.6/  7.6)     18  Alternate colors in tables with perl command?
  21.6 ( 10.3/ 11.2/  6.6)     14  Perl as solution?
  20.5 (  6.3/ 14.2/ 11.3)      7  Hangs - Netscape Enterprise Server 3.51 / Sybase web.sql 1.2 / Solaris 2.6
  20.4 ( 11.9/  6.3/  3.7)     16  new term for illogical
  20.3 (  9.5/  9.8/  6.8)     14  CGI.pm - forms within tables - How to?
  18.8 (  6.3/ 11.8/  4.6)      9  Need help with interpolation of a scalar !! ?
  18.8 (  7.3/ 11.1/  5.4)     10  Problems Using a Compare Subroutine with Sort

These threads accounted for 13.7% of the total volume.

Top 10 Threads by OCR (minimum of five posts)
==============================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.866  (  1.8/   2.0)      6  ****Can you show me a simple perl script to run the POST method?
0.866  (  9.0/  10.4)      6  Checking FS (File system)
0.861  ( 10.0/  11.6)      6  send geroge reese (was Re: Call for Participation: Python Conference)
0.838  (  9.3/  11.1)      7  HERE Documents and skipping indentation (advanced)
0.829  (  3.6/   4.4)      5  Hash Arrays
0.826  (  2.9/   3.5)      6  Does die close files (when caught) ?
0.795  ( 11.3/  14.2)      7  Hangs - Netscape Enterprise Server 3.51 / Sybase web.sql 1.2 / Solaris 2.6
0.788  (  4.2/   5.4)      5  Email parser
0.781  (  4.4/   5.6)      5  eq on if statement causing problems with string
0.743  (  3.0/   4.0)      7  Omaha Perl Mongers - First Meeting !

Bottom 10 Threads by OCR (minimum of five posts)
=================================================

         (kb)    (kb)
OCR      orig /  body  Posts  Subject
-----  --------------  -----  -------

0.472  (  2.9 /  6.2)      6  help needed
0.470  (  2.4 /  5.1)      5  Attaching file to sendmail pipe
0.460  (  2.1 /  4.5)      7  POLL: Perl features springing into your face
0.458  (  1.4 /  3.0)      5  CGI to CGI
0.445  (  7.0 / 15.8)     20  need a regular expressions expert....
0.438  (  1.4 /  3.1)      5  How do I sort a multidimensional array????
0.424  (  3.2 /  7.6)      6  Getting thePerl script's directory name
0.393  (  4.6 / 11.8)      9  Need help with interpolation of a scalar !! ?
0.390  (  1.6 /  4.0)      5  Coding Standards?
0.349  (  1.4 /  4.0)      5  Simple database recommendation needed

81 threads (19%) had at least five posts.

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      24  comp.lang.perl.modules
      12  comp.os.linux.misc
      12  comp.lang.python
       9  comp.lang.perl.moderated
       9  comp.lang.java.programmer
       7  comp.unix.solaris
       5  comp.lang.javascript
       5  comp.lang.perl.tk
       4  comp.sys.hp.misc
       4  comp.lang.perl

Top 10 Crossposters
===================

Articles  Address
--------  -------

       9  JP@somehost.somedomain (JP)
       6  adelton@fi.muni.cz
       6  Guenter Steinbach <guenter@arithmos.com>
       6  Patrick <pgh@ga.nl>
       6  "Jeffrey L. Taylor" <jltaylo@sandia.gov>
       6  larry@kiev.wall.org (Larry Wall)
       4  scott@mtnlake.com
       4  "Elaine -HappyFunBall- Ashton" <eashton@bbnplanet.com>
       4  gorilla@elaine.drink.com (Alan Barclay)
       3  joost@dt.net


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

Date: Mon, 05 Oct 1998 19:01:10 GMT
From: Hampton Keathley <hamptonk@bible.org>
Subject: subroutine problem
Message-Id: <36191853.47FD4E19@bible.org>

Greetings, 

I'm converting some html to sgml and need some help. I've written a
script that almost works. I just can't figure out the last part.

I have an html table row that looks like this.
<TR><TD WIDTH=234>text</TD><TD WIDTH=422>more text</TD></TR>
<TR><TD WIDTH=234>text</TD><TD WIDTH=422>more text</TD></TR>
<TR><TD WIDTH=234>text</TD><TD WIDTH=422>more text</TD></TR>
<TR><TD WIDTH=234>text</TD><TD WIDTH=422>more text</TD></TR>

I'm trying to write a script to search down a line grab all the cell
widths, add them up so I can then divide using the total and get the
percentage for each cell.

Then, I need to plug in the numbers in the <TR> tag so that it looks
like this <row tcw.20.20.60> with the numbers being a percentage.

Here's what I've go so far:

if ($line =~ /\<TR\>/){
	$totalpixels = 0;
	while ($line =~ /WIDTH/){
		$line =~ s/WIDTH\=(\d+)/HOWWIDE=$1/o;
		$cellwidth = $1;
		$totalpixels += $cellwidth;
		}
	
	$line =~ s/\<TD HOWWIDE=(\d+)\>/&replace($1)/ge;
		sub replace {
			my($width)=@_;
			$percentage = 0;
			$percentage = $width / $totalpixels;
			$percentage = int($percentage * 100);
			return "\n<cell w=$percentage>";
			}
		
		}	

This will actually return the proper percentages in each <cell tag> but
i need to concatenate all of the numbers into one string so that if I
have 4 columns, I get ".20.20.30.30" 

I tried adding this

while ($line =~ /\<TD HOWWIDE=(\d+)\>/){
	$line =~ s/\<TD HOWWIDE=(\d+)\>/&replace($1)/oe;
	$CELL[$cellcounter++] = $percentage;
	print $CELL[$cellcounter -1]."\n";
	}
	for ($counter = 1; $counter < $cellcounter; $counter++) {
		$cellwidths += "." . $CELL[$counter];
		}
		
	$line =~ s/\<TR.*?\>/\n<row tcw$cellwidths>/;
		
I'm stuck. I don't know if I'm actually sending the percentages to the
array or if, since it's in a subroutine, that I can't access it outside
the subroutine or what.


Thanks,

hampton


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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