[10818] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4419 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 14 11:07:35 1998

Date: Mon, 14 Dec 98 08:00:17 -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, 14 Dec 1998     Volume: 8 Number: 4419

Today's topics:
    Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/) (I R A Aggie)
    Re: a simple puzzle (I suspect) <Mukke@get2net.dk>
        Attach a file with a index-related filename <beekmans@iae.nl>
    Re: Calling API's (Bbirthisel)
    Re: Can't get counter Perl scripts to run under NT4 <freeking@nospam.hub.ofthe.net>
    Re: Finding what Package my Var is in with Debugger (Andrew M. Langmead)
    Re: flock for append (was: Re: getting http-referer) <merlyn@stonehenge.com>
        Frame question <ywang@engsoc.carleton.ca>
    Re: Get an Html page from another server <cunningt@primenet.com>
    Re: Get an Html page from another server <freeking@nospam.hub.ofthe.net>
    Re: getting http-referer (Andrew M. Langmead)
    Re: memory usage (Andrew M. Langmead)
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: preserving case insensitive after splitting a strin <freeking@nospam.hub.ofthe.net>
    Re: renaming an array with a number at the end (Jason Q.)
    Re: sorting hashes cnsxxx@my-dejanews.com
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 14 Dec 1998 10:03:24 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/)
Message-Id: <fl_aggie-1412981003240001@aggie.coaps.fsu.edu>

In article <752gnd$shi@slip.net>, emclean@slip.net (Emmett McLean) wrote:

+ >The FAQ doesn't get posted because it is INCLUDED with your copy of
+ >Perl.
+ 
+ Not mine. 

Then its broken. Complain to the appropriate person(s).

+ > And a mini-FAQ gets posted here every few days that says that.
+ 
+ You're grasping, I searched the most recent listing of 500 messages and didn't
+ find a match on FAQ. 

Really? I just did a subject search on my not-so-local-spool, and I came
up with 4 matches on 'FAQ'. Of that, two where pertinent:

Message-ID: <perl-resource-list-1-913604402@frii.com> [posted 13 Dec]
Message-ID: <pfaqmessage913116240.3330@news.teleport.com> [posted 8 Dec]

What was your argument again? 

+  And another mini-FAQ gets posted
+ >every few days to comp.lang.perl.announce as well.  Do we need to
+ >attach this info to EVERY post?  <sigh>
+ 
+ Absolutely not. If you are not inclined to answer you can pass.

Really, now? I'll expect a full apology for that statement.

+ >Emmett> In my case I researched the question for over a half hour with
+ >Emmett> Wall's text and didn't come up with an answer.
+ >
+ >Yes, I am intimately familiar with that text, and I can assure you
+ >that the answer is not there. :)

+ Hum, first you complain I didn't read the FAQ then you agree that the
+ answer is not there.

Wall's text is now the FAQ? well, perhaps...
 
+  That would be best. I'd appreciate answers and helpful suggestions
+  but don't look forward arrogance, grumpy posts and disparaging comments.

Here's a suggestion. Spend a week reading thru Programming Perl. Spend
another couple of days familiarizing yourself with 'perldoc' the command.
During that time, lurk here, and learn to work Dejanews.

Thems that learn to reach for the book on their shelf, and not the <post>
button, usually get better, faster answers...

James


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

Date: Sun, 13 Dec 1998 22:34:16 +0100
From: "Thomas Turn Jensen" <Mukke@get2net.dk>
Subject: Re: a simple puzzle (I suspect)
Message-Id: <JU9d2.211$Z%.673@news.get2net.dk>

Could you explain that *? to me? if so, I'd be very happy :)
Also.. I thought CELL was variable as well, which is why I didn't include it
in my substitution..

Mika Laari skrev i meddelelsen ...
>Thomas Turn Jensen <Mukke@get2net.dk> wrote:
>>$String =~ s/(\(\"?)(.*)(\"?\))/$1.lc($2).$3/ge;
>
>This helped me to solve the problem my way, which is not
>so different.  First, I add "CELL" to the beginning of
>the re, as was suggested in the request.  To let multiple
>quotes appear in the string, the *-quantifier is changed
>non-greedy.  And last, a change was made to grouping and
>to matching of "'s in order to let braces to appear in the
>quote.  Now here's the substitution:
>
>$String =~ s/(CELL\()(\"?)(.*?)(\2\))/$1.$2.lc($3).$4/ge;
>
>--
>- Mika Laari -




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

Date: Mon, 14 Dec 1998 16:26:16 +0100
From: Marcel Beekmans <beekmans@iae.nl>
Subject: Attach a file with a index-related filename
Message-Id: <36752E18.3F42A81E@iae.nl>


--------------27D9BD1663E592FD1A0D0F44
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I know it is possibility to attach a file to an email by using
MIME::Lite. That is if you know the exact filename. You can write it
down in the Path => ".... ";  statement. But what if the filename is
depanding on an index-number. I tried the following code, but it isn't
working coorectly because you probably may not put a variable name in
the Path => " ...." statment.
How can this problem be solved?

The example, which isn't working
----------------------------------------------

#!/usr/local/bin/perl -w

use MIME::Lite;
use Net::SMTP;
use strict;
use CGI qw(:standaard);

#here is a statemant which search if a file exists, if so $number is
increased.
#I didn't put it here in this example, because it doesn't matter much.
#and I assign "1" to$number

$number = 1;
$filetosend = "test$number.txt";
my($mailhost, $msg, $smtp, $data, $mime_all);

$mailhost = 'smtp.iae.nl';

# Create a new multipart message:
$msg = new MIME::Lite
    From     =>'mbeekmans@effector.nl',
    To       =>'beekmans@iae.nl',
    CC       =>'mbeekmans@effector.nl',
    Subject  =>'The message',
    Type     =>'multipart/mixed';

# attach text part
attach $msg
 Type     => 'TEXT',
 Data     => "Test met attachment";

#this part works correctly
#attch file part
attach $msg
    Type     => 'text/plain',
    Encoding =>'8bit',
    Path  =>'d:\Inetpub\hypotheekplein\cgi-bin\test.txt';

#this part isn't working correctly, because of the $filetosend parameter

#attach file part
attach $msg
    Type     => 'text/plain',
    Encoding => '8bit',
    Path     => 'D:\Inetpub\hypotheekplein\cgi-bin\$filetosend';

# the message as a string
$mime_all = $msg->as_string;

# now, send the attachment with Net::SMTP
$smtp = Net::SMTP->new($mailhost);
$smtp->mail('mbeekmans@effector.nl');
$smtp->to('beekmans@iae.nl');
$smtp->to('mbeekmans@effector.nl');

$smtp->data();
$smtp->datasend(<<END);
$mime_all
END

$smtp->dataend();
$smtp->quit();

print <<END_of_Start
Content-type: text/html

<HTML>
      <HEAD>
      <TITLE>Test</TITLE>
      </HEAD>
      <BODY>
      <H1>Test</H1>
      </BODY>
</HTML>
END_of_Start


--------------27D9BD1663E592FD1A0D0F44
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I know it is possibility to attach a file to an email by using MIME::Lite.
That is if you know the exact filename. You can write it down in the Path
=> ".... ";&nbsp; statement. But what if the filename is depanding on an
index-number. I tried the following code, but it isn't working coorectly
because you probably may not put a variable name in the Path => " ...."
statment.
<br>How can this problem be solved?
<p>The example, which isn't working
<br>----------------------------------------------
<p>#!/usr/local/bin/perl -w
<p>use MIME::Lite;
<br>use Net::SMTP;
<br>use strict;
<br>use CGI qw(:standaard);
<p>#here is a statemant which search if a file exists, if so $number is
increased.
<br>#I didn't put it here in this example, because it doesn't matter much.
<br>#and I assign "1" to$number
<p>$number = 1;
<br><b><i><font color="#FF6666"><font size=+1>$filetosend = "test$number.txt";</font></font></i></b>
<br>my($mailhost, $msg, $smtp, $data, $mime_all);
<p>$mailhost = 'smtp.iae.nl';
<p># Create a new multipart message:
<br>$msg = new MIME::Lite
<br>&nbsp;&nbsp;&nbsp; From&nbsp;&nbsp;&nbsp;&nbsp; =>'mbeekmans@effector.nl',
<br>&nbsp;&nbsp;&nbsp; To&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =>'beekmans@iae.nl',
<br>&nbsp;&nbsp;&nbsp; CC&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =>'mbeekmans@effector.nl',
<br>&nbsp;&nbsp;&nbsp; Subject&nbsp; =>'The message',
<br>&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp; =>'multipart/mixed';
<p># attach text part
<br>attach $msg
<br>&nbsp;Type&nbsp;&nbsp;&nbsp;&nbsp; => 'TEXT',
<br>&nbsp;Data&nbsp;&nbsp;&nbsp;&nbsp; => "Test met attachment";
<p>#this part works correctly
<br>#attch file part
<br>attach $msg
<br>&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp; => 'text/plain',
<br>&nbsp;&nbsp;&nbsp; Encoding =>'8bit',
<br>&nbsp;&nbsp;&nbsp; Path&nbsp; =>'d:\Inetpub\hypotheekplein\cgi-bin\test.txt';
<p>#this part isn't working correctly, because of the $filetosend parameter
<br>#attach file part
<br>attach $msg
<br>&nbsp;&nbsp;&nbsp; Type&nbsp;&nbsp;&nbsp;&nbsp; => 'text/plain',
<br>&nbsp;&nbsp;&nbsp; Encoding => '8bit',
<br>&nbsp;&nbsp;&nbsp; Path&nbsp;&nbsp;&nbsp;&nbsp; => 'D:\Inetpub\hypotheekplein\cgi-bin\<b><i><font color="#FF0000"><font size=+1>$filetosend</font></font></i></b>';
<p># the message as a string
<br>$mime_all = $msg->as_string;
<p># now, send the attachment with Net::SMTP
<br>$smtp = Net::SMTP->new($mailhost);
<br>$smtp->mail('mbeekmans@effector.nl');
<br>$smtp->to('beekmans@iae.nl');
<br>$smtp->to('mbeekmans@effector.nl');
<p>$smtp->data();
<br>$smtp->datasend(&lt;&lt;END);
<br>$mime_all
<br>END
<p>$smtp->dataend();
<br>$smtp->quit();
<p>print &lt;&lt;END_of_Start
<br>Content-type: text/html
<p>&lt;HTML>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;HEAD>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TITLE>Test&lt;/TITLE>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/HEAD>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;BODY>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;H1>Test&lt;/H1>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/BODY>
<br>&lt;/HTML>
<br>END_of_Start
<br>&nbsp;</html>

--------------27D9BD1663E592FD1A0D0F44--



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

Date: 14 Dec 1998 15:07:37 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: Calling API's
Message-Id: <19981214100737.12889.00000176@ng120.aol.com>

Hi Gernot:

The answer to both your questions is yes. See below for details.

>If you know a better group to place my questions, please tell me.

AcitiveState (www.activestate.com) maintains an extensive FAQ for
Win32-platform-specific questions like this. They also host a users
mailing list and archive the mailing list traffic. All are worth looking
at if you are using perl on NT/95/98. The traffic is NOT limited to
ActiveState ports, either. Many of the users are running the 5.004
"CORE" port.

-bill



Making computers work in Manufacturing for over 25 years (inquiries welcome)


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

Date: Sat, 12 Dec 1998 09:58:44 -0600
From: "Richard H. King" <freeking@nospam.hub.ofthe.net>
Subject: Re: Can't get counter Perl scripts to run under NT4
Message-Id: <753bsp$h2$1@remarQ.com>


|I have already used Matt Wright's excellent guestbook.pl script,
which I
|amended for my own needs.
Have you already tried Matt's Counter(s), then?





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

Date: Mon, 14 Dec 1998 15:38:25 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Finding what Package my Var is in with Debugger
Message-Id: <F3yos1.KoC@world.std.com>

narins@my-dejanews.com writes:

>Subject: Re: Finding what Package my Var is in with Debugger

Perl' has two types of variables. Package variables and lexical
variables. Lexical variables (the ones declared with my()) aren't in
any package. They are only visible within their scope, and have no
package designator.

-- 
Andrew Langmead


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

Date: Mon, 14 Dec 1998 14:59:34 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: flock for append (was: Re: getting http-referer)
Message-Id: <8c3e6ipy60.fsf@gadget.cscaper.com>

>>>>> "Larry" == Larry Rosler <lr@hpl.hp.com> writes:

Larry> Without looking into the perl sources, I assume that 'print "foobar\n"' 
Larry> might be implemented as a call to fwrite(3S).  'fwrite' copies its data 
Larry> string into a STDIO buffer and then, because the string has a "\n" and 
Larry> $| is set, calls fflush(3S), which calls write(2) -- which does the 
Larry> actual output after seeking to EOF because the file was opened with 
Larry> 'append'.  'fflush' then resets the buffer pointer to the beginning of 
Larry> the buffer.

I have seen STDIOs (V7, for one) that upon fopen(...,"a"), first
fseek() to the end, which positions the internal buffer pointer
possibly quite near the end of the internal buffer (since the internal
pointer is at the file pointer modulus the buffer size).

Maybe modern STDIOs don't do this, but it raises the possibility that
fwrite() will translate into two write(2)s because we've blown over
the end of the internal buffer, no matter how small.  If you can tell
me that you've done an exhaustive check of every STDIO currently in
use and that this never happens anywhere, I'll stop flocking my
files. :)

print "Just another Perl hacker (and vintage Unix hacker),"

-- 
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@teleport.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: 14 Dec 1998 15:48:16 GMT
From: Yue Wang <ywang@engsoc.carleton.ca>
Subject: Frame question
Message-Id: <753c00$93t$1@bertrand.ccs.carleton.ca>


Hi,
	I have two frames, let's say frame1.html and frame2.html. And
there's a frame2.cgi, this script is supposed to update the content of
frame1.html. My question is if it's possible to refresh frame1.html
without manually reload it? To be more precise, I'd like to see frame1
changes it's content automatically when I click the submit button in
frame2. Any suggestions? By the way, they are open side by side. thanks a
lot!

-- 

-------------------------------------------------------------------------
Tony Y Wang
System &Computer Engineering
ywang@engsoc.carleton.ca
-------------------------------------------------------------------------


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

Date: 14 Dec 1998 15:17:47 GMT
From: Thomas Cunningham <cunningt@primenet.com>
Subject: Re: Get an Html page from another server
Message-Id: <753a6r$m03$1@nnrp02.primenet.com>

I R A Aggie <fl_aggie@thepentagon.com> writes:

: perldoc LWP contains the information you seek.

: James

Is there an easy way to do this without the LWP module?


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

Date: Sat, 12 Dec 1998 09:45:06 -0600
From: "Richard H. King" <freeking@nospam.hub.ofthe.net>
Subject: Re: Get an Html page from another server
Message-Id: <753b37$sv6$1@remarQ.com>

Thomas Cunningham wrote in message <753a6r$m03$1@nnrp02.primenet.com>...
>Is there an easy way to do this without the LWP module?

LWP is pretty dern easy (if a bonehead like me can figure it out, anyone
can).
Copy and paste the example from the LWP Docs and there you go.

If you're asking because you can't/won't use LWP, then it's still not to
hard to script up something to do it.

Just make a connection on port 80 to the server you want, and send it the
following string:
"GET /foo/bar.html HTTP/1.0\n\n"

You can get info on how to make the said connection from the docs, and you
can test your ideas by
'telnet www.fooserver.com 80'
from the command-line, and then try the HTTP commands right there.  IE: 'GET
/'






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

Date: Mon, 14 Dec 1998 15:11:21 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: getting http-referer
Message-Id: <F3ynIx.4pM@world.std.com>

Randal Schwartz <merlyn@stonehenge.com> writes:

>>>>>> "John" == John Bokma <postmaster@castleamber.com> writes:

>John> AFAIK, locking is *not* needed when you *append*
>John> to a file (single line), it's an atomic operation.

>Only if you use sysopen and syswrite.  Which you didn't.

I can understand syswrite(), but why do you need sysopen()?

-- 
Andrew Langmead


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

Date: Mon, 14 Dec 1998 15:46:26 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: memory usage
Message-Id: <F3yp5E.4n3@world.std.com>

boson@earthlink.net (Boson) writes:

>I have a quick question. Assume I have a (pretty big) hash called %h.
>Is my perl program using less memory if I use the hash as

>   foreach (keys \%h) {...}

This isn't going to work. The first argument to keys() has to be a
hash, not a reference to one.

>unstead of the usual (for me) foreach syntax

>   foreach (keys %h) {...}

This will create a temporary list consisting of all the keys. If %h is
very big, then the list returned will be too.

Have you though of using the each() operator?

while(($key, $value) = each %h) {
}

The each function iterates through the list, returning one key/value
pair each invocation.



-- 
Andrew Langmead


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

Date: 14 Dec 1998 15:33:42 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <753b4m$nr$3@info.uah.edu>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 07 Dec 1998 14:51:23 GMT and ending at
14 Dec 1998 08:02:53 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:  213 (45.3% of all posters)
Articles: 295 (24.7% of all articles)
Volume generated: 455.9 kb (23.0% of total volume)
    - headers:    200.0 kb (4,193 lines)
    - bodies:     250.2 kb (8,053 lines)
    - original:   198.8 kb (6,622 lines)
    - signatures: 5.3 kb (167 lines)

Original Content Rating: 0.795

Averages
========

Posts per poster: 1.4
    median: 1 post
    mode:   1 post - 163 posters
    s:      1.0 post
Message size: 1582.3 bytes
    - header:     694.3 bytes (14.2 lines)
    - body:       868.6 bytes (27.3 lines)
    - original:   690.2 bytes (22.4 lines)
    - signature:  18.5 bytes (0.6 lines)

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

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

    6     6.9 (  3.7/  3.2/  1.5)  NOSPAM_umsee@microasia.com (umsee)
    6    18.9 (  4.6/ 14.2/  4.2)  mike_orourke@em.fcnbd.com
    5     7.1 (  3.6/  3.5/  1.4)  newsposter@cthulhu.demon.nl
    5     8.9 (  3.1/  5.8/  4.2)  terry577@aol.com (terry hinds)
    4     5.8 (  2.8/  3.1/  3.1)  niral@corporate.planet.net
    4     7.6 (  2.8/  4.8/  3.9)  jon@amxstudios.com
    4     4.4 (  2.4/  2.0/  2.0)  om7@cyberdude.com
    4     4.8 (  2.7/  2.1/  1.0)  Silver CHEN <sansil@pchome.com.tw>
    3     6.2 (  2.6/  3.6/  2.7)  Chris Hobbs <chobbs@silvervalley.k12.ca.us>
    3     4.9 (  2.3/  1.7/  1.5)  "FENG XIAN, ALEX" <feng_xian@mitel.com>

These posters accounted for 3.7% of all articles.

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

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

  18.9 (  4.6/ 14.2/  4.2)      6  mike_orourke@em.fcnbd.com
  11.2 (  1.4/  9.7/  9.6)      2  "Owen" <info@kn1.com>
   8.9 (  3.1/  5.8/  4.2)      5  terry577@aol.com (terry hinds)
   7.6 (  2.8/  4.8/  3.9)      4  jon@amxstudios.com
   7.1 (  3.6/  3.5/  1.4)      5  newsposter@cthulhu.demon.nl
   7.0 (  2.0/  4.9/  4.5)      3  andrewc@newtonsols.net
   6.9 (  3.7/  3.2/  1.5)      6  NOSPAM_umsee@microasia.com (umsee)
   6.4 (  0.7/  5.6/  4.3)      1  vlb@cfcl.com (Vicki Brown)
   6.2 (  2.6/  3.6/  2.7)      3  Chris Hobbs <chobbs@silvervalley.k12.ca.us>
   5.8 (  2.8/  3.1/  3.1)      4  niral@corporate.planet.net

These posters accounted for 4.3% of the total volume.

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

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

1.000  (  3.1 /  3.1)      4  niral@corporate.planet.net
1.000  (  2.0 /  2.0)      4  om7@cyberdude.com
0.977  (  3.6 /  3.7)      3  cgi@higherlove.com
0.939  (  1.2 /  1.3)      3  "mark reed" <marst96@pitt.edu>
0.915  (  1.0 /  1.0)      3  Jim Savarino <jsavarino@jps.net>
0.914  (  4.5 /  4.9)      3  andrewc@newtonsols.net
0.881  (  1.5 /  1.7)      3  "FENG XIAN, ALEX" <feng_xian@mitel.com>
0.819  (  3.9 /  4.8)      4  jon@amxstudios.com
0.818  (  1.7 /  2.0)      3  "Enrico Ng" <ng@usa.net>
0.734  (  2.7 /  3.6)      3  Chris Hobbs <chobbs@silvervalley.k12.ca.us>

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

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

0.818  (  1.7 /  2.0)      3  "Enrico Ng" <ng@usa.net>
0.734  (  2.7 /  3.6)      3  Chris Hobbs <chobbs@silvervalley.k12.ca.us>
0.725  (  4.2 /  5.8)      5  terry577@aol.com (terry hinds)
0.706  (  1.2 /  1.8)      3  23_skidoo@geocities.com
0.662  (  2.4 /  3.6)      3  darrenl@cats.ucsc.edu
0.550  (  0.4 /  0.7)      3  mitch@thepixelfarm.com (Mitch Rosefelt)
0.462  (  1.5 /  3.2)      6  NOSPAM_umsee@microasia.com (umsee)
0.457  (  1.0 /  2.1)      4  Silver CHEN <sansil@pchome.com.tw>
0.388  (  1.4 /  3.5)      5  newsposter@cthulhu.demon.nl
0.296  (  4.2 / 14.2)      6  mike_orourke@em.fcnbd.com

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


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

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

       4  Dirk Schumacher <Dirk.Schumacher@depot147.dpd.de>
       4  Ilia Perminov <ilia@jet.msk.su>
       3  sweh@mpn.com (Stephen Harris)
       3  brewer@avanticorp.com
       2  M Dominic Ryan <ryanmd@mh.us.sbphrd.com>
       2  Yukihiro Matsumoto <matz@netlab.co.jp>
       2  kyle@kylecordes.com (Kyle Cordes)
       2  "John Hankey" <monkey@chisp.net>
       2  Peter W <peterw@clark.net>
       2  mlh@zipper.zip.com.au (Matthew Hannigan)


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

Date: Sat, 12 Dec 1998 09:31:09 -0600
From: "Richard H. King" <freeking@nospam.hub.ofthe.net>
Subject: Re: preserving case insensitive after splitting a string
Message-Id: <753a40$qav$1@remarQ.com>

I'm a relatively new Perl user, but here are my best guesses anyway:

>I have a case insensitive (?i)$string.
>If I split that string into an @array, every element no longer remain
>case insensitive.
If I know what you're asking, I'd say you should actually make them all
lower-case (or upper, if you prefer) via  lc("string") or "\Lstring".

>@array = (bird, hand, worth, bush);
>$string = "bird in hand is worth two in bush";
>
>If ($string contains every element in @array)
> {
>  do this;
> }
This may not be the most CPU-Efficient way (or maybe it is, 'use Benchmark'
to figure it out).
It's also probably not the coolest, either.
But Hey.

for (@array)
{
 $string!~/.*$_.*/ and $couldnt_match_all=1 and last;
}
unless ($couldnt_match_all)
{
 do that;
}
undef $couldnt_match_all; # (reset)




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

Date: Mon, 14 Dec 1998 15:36:41 GMT
From: pigs_can_fly@mindless.com (Jason Q.)
Subject: Re: renaming an array with a number at the end
Message-Id: <367b3082.47867203@news.cyberway.com.sg>

Thanks Stuart, it works but now another question plagues me.

How does this:
 ------------------------------
$z = 0;
$d = 0;
foreach (@finalword)
	{
	@{$d+1} = grep(/$finalword[$z]/,@{$d});
	$z++;
	$d++;
	}
 ------------------------------
differ from this:
 ------------------------------
$z = 0;
$d = 0;
$count = 5;
while ($z < $count)
	{
	@{$d+1} = grep(/$finalword[$z]/,@{$d});
	$z++;
	$d++;
	}
 ------------------------------

They seem to give the same results but are there any considerations to
take into, any pitfalls? Which is more efficient?

Thanks.

Jason Q.


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

Date: Mon, 14 Dec 1998 15:32:10 GMT
From: cnsxxx@my-dejanews.com
Subject: Re: sorting hashes
Message-Id: <753b1r$2e1$1@nnrp1.dejanews.com>

unfortunately....the 'values' in the hash are counters..and therefore *can* be
the same   :-(

Chris
-----

  "Allan M. Due" <Allan@due.net> wrote:
> cnsxxx@my-dejanews.com wrote in message <752qp6$l1n$1@nnrp1.dejanews.com>...
> >Hi,
> >I have an associative array/hash (%myhash) as follows
> >key  val
> >---  ---
> >abc  1
> >def  12
> >ghi  6
> >How do I sort the hash to print out both the keys and values
> >sorted by the values?
>
> Assuming there are only unique values, one simple way might be to just
> reverse your hash:
>
> #!/usr/local/bin/perl -w
> use strict;
> #assuming only unique values in the hash;
>
> my %myhash =
>        qw(abc 1
>            def  12
>            ghi  6);
>
> my %mirror = reverse %myhash;
>
> my @sorted = sort {$a <=> $b} keys %mirror;
>
> foreach my $value (@sorted) {
>     print "Key is $mirror{$value}, Value is $value\n";
> }
>
> HTH
>
> AmD
>
>

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


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

Date: 14 Dec 1998 15:34:08 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <753b5g$nr$4@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 07 Dec 1998 14:51:23 GMT and ending at
14 Dec 1998 08:02:53 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:  470
Articles: 1196 (418 with cutlined signatures)
Threads:  393
Volume generated: 1985.5 kb
    - headers:    820.1 kb (16,963 lines)
    - bodies:     1088.1 kb (35,572 lines)
    - original:   752.9 kb (26,645 lines)
    - signatures: 76.2 kb (1,656 lines)

Original Content Rating: 0.692

Averages
========

Posts per poster: 2.5
    median: 1.0 post
    mode:   1 post - 302 posters
    s:      4.9 posts
Posts per thread: 3.0
    median: 2 posts
    mode:   1 post - 127 threads
    s:      2.8 posts
Message size: 1699.9 bytes
    - header:     702.1 bytes (14.2 lines)
    - body:       931.6 bytes (29.7 lines)
    - original:   644.6 bytes (22.3 lines)
    - signature:  65.2 bytes (1.4 lines)

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

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

   51    84.6 ( 29.2/ 55.4/ 38.9)  tadmc@metronet.com (Tad McClellan)
   42    75.3 ( 26.8/ 43.8/ 28.2)  lr@hpl.hp.com (Larry Rosler)
   36    64.0 ( 29.2/ 27.4/ 18.2)  mgjv@comdyn.com.au (Martien Verbruggen)
   28    43.1 ( 23.9/ 19.2/ 12.3)  bart.lateur@skynet.be (Bart Lateur)
   22    35.5 ( 16.9/ 12.8/  6.8)  rjk@linguist.dartmouth.edu (Ronald J Kimball)
   21    38.3 ( 14.3/ 19.6/  9.8)  Jonathan Stowe <gellyfish@btinternet.com>
   21    28.7 ( 14.6/ 10.4/  5.8)  comdog@computerdog.com (brian d foy)
   21    33.8 ( 18.4/ 14.6/  8.5)  Rick Delaney <rick.delaney@home.com>
   20    36.8 ( 12.5/ 24.3/ 16.3)  "Allan M. Due" <Allan@due.net>
   17    33.1 ( 12.0/ 20.8/ 13.3)  dragons@scescape.net (Matthew Bafford)

These posters accounted for 23.3% of all articles.

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

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

  84.6 ( 29.2/ 55.4/ 38.9)     51  tadmc@metronet.com (Tad McClellan)
  75.3 ( 26.8/ 43.8/ 28.2)     42  lr@hpl.hp.com (Larry Rosler)
  64.0 ( 29.2/ 27.4/ 18.2)     36  mgjv@comdyn.com.au (Martien Verbruggen)
  43.1 ( 23.9/ 19.2/ 12.3)     28  bart.lateur@skynet.be (Bart Lateur)
  38.3 ( 14.3/ 19.6/  9.8)     21  Jonathan Stowe <gellyfish@btinternet.com>
  36.8 ( 12.5/ 24.3/ 16.3)     20  "Allan M. Due" <Allan@due.net>
  35.5 ( 16.9/ 12.8/  6.8)     22  rjk@linguist.dartmouth.edu (Ronald J Kimball)
  33.8 ( 18.4/ 14.6/  8.5)     21  Rick Delaney <rick.delaney@home.com>
  33.1 ( 12.0/ 20.8/ 13.3)     17  dragons@scescape.net (Matthew Bafford)
  32.2 (  4.8/ 26.8/ 25.3)      9  Greg Bacon <gbacon@cs.uah.edu>

These posters accounted for 24.0% of the total volume.

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

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

0.980  (  5.2 /  5.3)      6  fl_aggie@thepentagon.com (I R A Aggie)
0.947  ( 25.3 / 26.8)      9  Greg Bacon <gbacon@cs.uah.edu>
0.867  ( 16.7 / 19.3)     14  aml@world.std.com (Andrew M. Langmead)
0.866  (  3.0 /  3.5)      6  "E. Preble" <preble@ipass.net>
0.819  (  3.4 /  4.2)      5  moseley@best.com (Bill Moseley)
0.767  (  9.2 / 11.9)     13  mjd@op.net (Mark-Jason Dominus)
0.752  (  4.9 /  6.5)      7  eln@cyberhighway.net (Erik)
0.731  (  4.4 /  6.0)      9  dturley@pobox.com
0.725  (  4.2 /  5.8)      5  terry577@aol.com (terry hinds)
0.724  (  7.1 /  9.9)      9  clay@panix.com (Clay Irving)

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

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

0.476  (  5.7 / 12.0)     15  Uri Guttman <uri@ibnets.com>
0.471  (  3.3 /  7.0)      8  Eric Bohlman <ebohlman@netcom.com>
0.462  (  1.5 /  3.2)      6  NOSPAM_umsee@microasia.com (umsee)
0.433  (  2.8 /  6.6)     10  Uri Guttman <uri@sysarch.com>
0.400  (  2.5 /  6.1)     11  Tk Soh <r28629@email.sps.mot.com>
0.388  (  1.4 /  3.5)      5  newsposter@cthulhu.demon.nl
0.371  (  2.2 /  6.1)      7  "Allan M. Due" <due@murray.fordham.edu>
0.357  (  4.2 / 11.7)      8  phenix@interpath.com (John Moreno)
0.336  (  1.8 /  5.2)      7  samc@empirewest.com (Sam Curren)
0.296  (  4.2 / 14.2)      6  mike_orourke@em.fcnbd.com

47 posters (10%) had at least five posts.

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

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

   22  Better way to get values from a list?
   20  Y2K potential problem in localtime()
   16  Beginner Book?
   14  Decent Editor
   13  Code Bash: File Include
   13  Sorting problem: Is there a better way?
   13  Splitting a string at a certain point
   13  Assignment to same variable
   12  a simple puzzle (I suspect)
   12  Can someone tell me why ....

These threads accounted for 12.4% of all articles.

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

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

  45.5 ( 14.0/ 29.3/ 18.6)     16  Beginner Book?
  43.4 ( 15.5/ 26.4/ 14.8)     22  Better way to get values from a list?
  37.4 (  8.3/ 27.3/ 20.7)     13  Sorting problem: Is there a better way?
  34.5 ( 15.7/ 17.7/ 10.5)     20  Y2K potential problem in localtime()
  32.2 (  9.5/ 19.6/ 10.0)     11  80 column conversion
  31.0 (  8.7/ 20.1/ 16.0)     12  Can someone tell me why ....
  25.5 (  8.3/ 16.7/  5.2)     11  Errors with SETUID and Perl Script
  24.7 (  6.6/ 17.3/  9.9)     10  ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/)
  23.2 (  4.1/ 18.8/ 15.4)      6  STANDARD PERL for WIN 95/NT EXECUTABLE
  21.4 (  9.4/ 11.6/  7.6)     13  Splitting a string at a certain point

These threads accounted for 16.1% of the total volume.

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

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

0.868  (  2.8/   3.2)      5  shift.
0.828  (  4.5/   5.4)      6  ls -l in perl?
0.828  (  6.0/   7.3)      9  Why Is Perl not a Language?
0.818  (  4.1/   5.1)      8  New to perl - pattern matching question
0.817  ( 15.4/  18.8)      6  STANDARD PERL for WIN 95/NT EXECUTABLE
0.802  (  6.0/   7.5)      5  Change Directory
0.793  ( 16.0/  20.1)     12  Can someone tell me why ....
0.787  (  5.3/   6.7)      5  Newbie Question
0.786  (  2.9/   3.7)      7  array initialisation
0.778  (  5.0/   6.4)      7  flock doesn't flock under perl/linux

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

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

0.530  (  1.7 /  3.2)      6  Regular Expression help
0.525  (  5.2 /  9.9)     13  Code Bash: File Include
0.519  (  1.2 /  2.4)      5  Perl Floating Point Rounding Algorithm?
0.511  (  4.9 /  9.6)      6  Is there a 'predeclare subs' module ?
0.509  (  1.5 /  2.9)      5  getting http-referer
0.508  ( 10.0 / 19.6)     11  80 column conversion
0.482  (  3.5 /  7.2)     12  a simple puzzle (I suspect)
0.480  (  2.1 /  4.3)      5  Accessing MS SQL db from unix
0.430  (  4.0 /  9.2)     13  Assignment to same variable
0.309  (  5.2 / 16.7)     11  Errors with SETUID and Perl Script

72 threads (18%) had at least five posts.

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

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

      22  comp.lang.perl.modules
      11  comp.lang.perl
       8  comp.infosystems.www.servers.unix
       5  pl.comp.lang.perl
       5  comp.os.linux.misc
       3  comp.databases.oracle.server
       3  han.comp.lang.perl
       3  alt.perl
       3  han.comp.os.linux
       3  comp.databases.oracle.misc

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

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

       7  tadmc@metronet.com (Tad McClellan)
       6  Jonathan Stowe <gellyfish@btinternet.com>
       4  Dirk Schumacher <Dirk.Schumacher@depot147.dpd.de>
       4  Ilia Perminov <ilia@jet.msk.su>
       3  groenvel@cse.psu.edu (John D Groenveld)
       3  Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
       3  hklife@soback.kornet21.net
       3  sweh@mpn.com (Stephen Harris)
       3  brewer@avanticorp.com
       2  mlh@zipper.zip.com.au (Matthew Hannigan)


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

Date: 12 Dec 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 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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