[8691] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2308 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 13 12:07:27 1998

Date: Mon, 13 Apr 98 09:00:25 -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, 13 Apr 1998     Volume: 8 Number: 2308

Today's topics:
    Re: [Q] find largest value in key of associative array? <jdporter@min.net>
    Re: [Q] find largest value in key of associative array? (Mark-Jason Dominus)
    Re: [Q] find largest value in key of associative array? (Abigail)
    Re: Book: Perl Modules (Chris Winters)
        Confused - pod and man files (Daniel)
    Re: Converting  Perl <robk@@NOSPAM.stack.nl>
    Re: dbmopen legacy problems (Mark-Jason Dominus)
    Re: General Rudeness, e.g. Re: Need a web login script (Andrew M. Langmead)
    Re: Info Regarding Perl 5.005 <jdporter@min.net>
    Re: Is it just me?  (error/bug? with "my") -- Interesti <cortez@tfn.com>
    Re: MacPerl Book Online in HTML <neeri@iis.ee.ethz.ch>
        Need to find web-based e-mail client in Perl! <ea187@columbia.edu>
    Re: Profiling resource use <jhi@alpha.hut.fi>
        Remove newline <agator@imaxx.net>
    Re: Remove newline <smubit1@gl.umbc.edu>
    Re: Remove newline (Juergen Heinzl)
    Re: RMS should be invited to O'Reilly's "Free Software  (Tim Smith)
        Run perl script as suid - C wrapper as work-around <hubert.schumacher@synapse.lu>
    Re: Run perl script as suid - C wrapper as work-around <rra@stanford.edu>
        Search with "near" feature antonio.m.enrique@state.ma.us
    Re: Sockets, Multi-line input, and efficiency (Andrew M. Langmead)
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: Strange "Modification of a read-only value attempte <dformosa@st.nepean.uws.edu.au>
    Re: wc -l in perl is?????? (Mark-Jason Dominus)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 13 Apr 1998 14:06:01 GMT
From: John Porter <jdporter@min.net>
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <35321D2E.43D2@min.net>

Trivial, my friend.

$largest = (sort { $b <=> $a } keys %aa)[0];

hth,
John Porter


Stephen_Chan wrote:
> 
> What's the fastest way to find the largest key value
> in an associative array? eg:
> 
> %aa
> 
> key             value
> ----            ------
> 1               some_content_1
> 23              some_content_1
> 5               some_content_1
> 48              some_content_1
> .                       .
> .                       .
> N               some_content_N
> 
> In the above list, assume there's 10000 pairs and the
> 4634th key/value pair holds the largest key value of
> 34235. Do I have to manually iterate through to find it?
> 
> Thanks
> Stephen


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

Date: 13 Apr 1998 10:24:44 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <6gt77c$jng$1@monet.op.net>

In article <01bd66cb$a9542460$1ff8aecc@direct.ca.direct.ca>,
Stephen_Chan <schan_ca@rocketmail.com> wrote:
>What's the fastest way to find the largest key value

Hi.  Don't say `key value' because you will confuse everyone.  A hash
has keys, and associated with the keys are values, and if you say `key
value' people will assume you're talking about the keys, rather than
the values.

Anyway, use

	($max_value) = sort { $b <=> $a } values %aa;

to get the largest numeric value.  Replace <=> with your favorite
comparison function if numeric magnitude isn't the sense of `large'
that you want.  

It would be more efficient to do this:

	(undef, $maxval) = each %aa;
	while (($k, $v) = each %aa) {
	  $maxval = $v if $v > $maxval;
	}

	# Largest value is now in $maxval.

Replace `>' with whatever is needful.


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

Date: 13 Apr 1998 15:32:03 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <6gtb5j$l7b$1@client2.news.psi.net>

James Ludlow (ludlow@us.ibm.com) wrote on MDCLXXXVI September MCMXCIII in
<URL: news:35320F00.E7CEC9F7@us.ibm.com>:
++ Stephen_Chan wrote:
++ > 
++ > What's the fastest way to find the largest key value
++ > in an associative array? eg:
++ > 
++ > %aa
++ > 
++ > key             value
++ > ----            ------
++ > 1               some_content_1
++ > 23              some_content_1
++ > 5               some_content_1
++ > 48              some_content_1
++ > .                       .
++ > .                       .
++ > N               some_content_N
++ > 
++ > In the above list, assume there's 10000 pairs and the
++ > 4634th key/value pair holds the largest key value of
++ > 34235. Do I have to manually iterate through to find it?
++ 
++ Alphabetically:
++ $largest_key = (sort keys %hash)[-1];
++ 
++ Numerically:
++ $largest_key = (sort {$a <=> $b} %hash)[-1];


*PLEASE*

What's the point of suggesting an Omega (N log N) algorithm
if there's a trivial O (N)?


foreach ($max = each %hash;
         defined ($a = each %hash);
         $max = $a if $a > $max) {}



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


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

Date: Mon, 13 Apr 1998 14:01:07 GMT
From: cwinters@intes.net (Chris Winters)
Subject: Re: Book: Perl Modules
Message-Id: <35321a36.2297083@news.cais.com>

On Sat, 11 Apr 1998 09:02:48 -0400, "Peter Perchansky" <fp@pmpcs.com>
wrote:

>I bought the book (from Amazon.com).  While it is still worth it, it does
>not cover a lot of modules and the coverage examples are short and not as
>many as I would have liked to see.

Thanks. I'd heard good things about Eric Foster-Johnson's earlier
books and like what I've gone though of the _Graphical Tcl + Tk_ book
I've got. I'm curious to learn more about creating modules (beyond the
excellent documentation with Perl, of course) and thought this might
be a way to go.

Chris



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

Date: 13 Apr 1998 15:45:43 GMT
From: daniel.mendyke@digital.com (Daniel)
Subject: Confused - pod and man files
Message-Id: <6gtbv7$d3o$1@nntpd.lkg.dec.com>


I'm running Perl under NT and am confused about 
how the documentation is layed out.  Just how
do I read pod files or man files.  

When I run the 'perldoc.bat' file I see
a long list of files being ignored and
only sometimes do I see information on
the topic I requested.

Also, when I build a module, does the build
copy module documentation files to my main
Perl directory?

(Can anyone guess I do not come from a UNIX background?)

-Daniel
daniel.mendyke@digital.com



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

Date: 13 Apr 1998 14:41:32 GMT
From: Rob Kouwenberg <robk@@NOSPAM.stack.nl>
Subject: Re: Converting  Perl
Message-Id: <6gt86s$14d@tuegate.tue.nl>

James Kenny <kennyj@postoffice.co.uk> wrote:
: I have a numberof Perl Scripts running on a UNIX box.  
: I need to convert the Perl so it will run on NT Server.  
: Are there any insumountable problems I am likely to come up against.
: I know a lot will depend on the application but is there any show stoppers
: when converting from UNIX to NT.
: I also no nothing about Perl yet but I have a feeling that will change!

Wow, That's what downgrading is all about. A pity you went to mickeysoft...
-- 
[ robk@@NOSPAM.stack.nl ]
NOTE : remove @NOSPAM for proper emailing


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

Date: 13 Apr 1998 11:04:38 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: dbmopen legacy problems
Message-Id: <6gt9i6$k1g$1@monet.op.net>

In article <6gkeur$ac9$1@vnetnews.value.net>,
Coffman  <coffman@value.net> wrote:
>We have a website with many dbmopen's, so it is using the standard
>NDBM_File.
>We get many failures on the dbmopen, with $! eq "Resource temporarily
>unavailable".  This does not happen all of the time, but only some of
>the time.  It seems to happen most frequently at peak usage times.  

If these were GDBM files, I would feel sure that I understood the
problem.  When you open a GDBM file, it locks it for you, to prevent
concurrent access that could corrupt the file contents.  If you open
it only for reading, it uses a shareable lock; if you open for
writing, it uses an exclusive lock.  If it can't get the lock, it
fails and sets $! to `resource temporarily unavailable'.  If you use
`dbmopen' instead of `tie', you get write access, so it tries for an
exclusive lock.

I have never heard that NDBM also did this, but perhaps it does, and
perhaps that is what is happening to you.  You could do some easy
tests to find out, or look at the source.

>Does anyone have any idea why this might be happening?  I assume that
>this is some failing of NDBM, since that is what dbmopen will use
>first.  I can convert the data files to use DB_File, but I'd like to
>know if that would even help?

If my guess is right, then it will either not help, or it will make
your problem much, much worse.  DB_File probably does do the automatic
locking, but if it doesn't and if no file locking is done to prevent
concurrent access, your database is likely to become corrupted, and
you will lose all your data.

If I'm right, you have several possible solutions:

1. If you only need read access to the database, replace `dbmopen'
   with the appropriate `tie' that specifies read-only access, and see
   if that generates a shared lock instead of an exclusive one.

2. Wrap the tie/dbmopen call as follows:

   for (;;) {
     last if my $rc = tie/dbmopen ... ;
     if ($! =~ /resource\ temporarily\unavailable
                |
                try\ again
               /ix) {
       warn "Database locked; will try again in $ZZZZZ sec";
       sleep $ZZZZZ;
     } else {
       die "Couldn't bind DBM file: $!; aborting";
     }
   }

3. If file locking is interfering with concurrency, get a real
   database server like Oracle or MySQL or something and use that instead.


Note that these three solutions are not exclusive of one another.


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

Date: Mon, 13 Apr 1998 15:34:50 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: General Rudeness, e.g. Re: Need a web login script
Message-Id: <ErCzA3.6B4@world.std.com>

tmornini@netcom.com (Tom Mornini) writes:

>I'll just finish with one simple question: What would happen if someone
>asked an inappropriate question and EVERYONE failed to respond.

>From past experience, two things commonly happen.

1. Someone posts with an incorrect answer. Then either the incorrect
answer stands as fact, (and this is more dangerous now, with things
like Deja News) or more knowledgable people have to post to correct
the incorrect reply.

2. The original author posts again, saying the no one helped him and
start throwing out insults.

-- 
Andrew Langmead


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

Date: Mon, 13 Apr 1998 14:00:42 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Info Regarding Perl 5.005
Message-Id: <35321BEF.4F93@min.net>

On Sun, 12 Apr 1998, in article <6gpo9t$1jo$1@client2.news.psi.net>
abigail@fnx.com (Haijo Schipper) wrote:
> 
> Randal Schwartz (merlyn@stonehenge.com) wrote on MDCLXXXV September
> MCMXCIII in <URL: news:8ciuofu3oj.fsf@gadget.cscaper.com>:
> ++
> ++ So, you end up with two binaries (and two sets of site_perl as well,
> ++ since the so's aren't compatible either).
> 
> since
> you seem to be on the side that says "we don't need to stinking threads",
> why would you need the threaded perl version? 

I think Randal said "you end up with", not "I end up with".  For all we
know,
Randal would only have the one binary for himself.

John Porter


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

Date: Mon, 13 Apr 1998 10:08:12 -0400
From: Frank Cortez <cortez@tfn.com>
To: "M.J.T. Guy" <mjtg@cus.cam.ac.uk>
Subject: Re: Is it just me?  (error/bug? with "my") -- Interesting Twist
Message-Id: <35321C4C.1D94@tfn.com>

M.J.T. Guy wrote:
> 
> In article <352E73DD.1F45@tfn.com>, Frank Cortez  <cortez@tfn.com> wrote:
> >When in the debugger, say I've "stepped" into a routine
> >called 'Routine', resulting in my being on the first line
> >of Routine, which reads:
> >
> >my ($var) = @_;
> >
> >Now, if I step past this line (say two lines, just to be
> >sure it's executed), I *should* be able to see the value in
> >$var using 'X var'-- shouldn't I?
> 
> No.    "X" prints _package_ variables.   Lexicals aren't package variables.
> Use the "x" or "p" commands.
> 
> Mike Guy

Whoa!  There's an 'x' command?  Looks like it's time to update
my documentation... Thanks for the reference to package variables;
I knew there was ignorance about *something* here, I just didn't
have a concept for which to look in all my references...

Thanks!

-Frank


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

Date: 13 Apr 1998 16:39:20 +0200
From: Matthias Neeracher <neeri@iis.ee.ethz.ch>
Subject: Re: MacPerl Book Online in HTML
Message-Id: <86emz1hjl3.fsf@gwaihir.ethz.ch>

lvirden@cas.org writes:
> As an alternative to your proposal to vote or email the author on
> things needed in his book, perhaps an alternative would be for you or
> someone else to write a book of perl exercises that could be used in
> conjunction to the original book!

Well, in our media-rich times, maybe somebody should do a "Perl Exercise Video"
instead of a dusty old Perl Exercise Book :-)

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


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

Date: Mon, 13 Apr 1998 10:57:08 -0400
From: Elmira Alimova <ea187@columbia.edu>
Subject: Need to find web-based e-mail client in Perl!
Message-Id: <353227C4.9329DD6B@columbia.edu>

Hello! My school is installing web kiosks for the students. Idea is to
enable them to get mail also. If anyone knows of perl script that will
work as a web-based e-mail client,let me know. Help is greatly
appreciated. 
E.


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

Date: 13 Apr 1998 17:53:42 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Profiling resource use
Message-Id: <oee4szxn56x.fsf@alpha.hut.fi>


Richard Karpinski <dick@cfcl.com> writes:

> 
> Eric Bohlman wrote:
> 
> >> Perl programs: CPU time, I/O requests, RAM consumption. 
> > 
> > I'd say that the Benchmark module is "known," given that it comes with
> > the standard distribution.  Is there anything you want to do that you
> > can't do with it?
> 
> Known it is.  But it does none of what I need.  The one second
> resolution is useless for in vivo testing.  The perldoc says 

One second resolution of *real* time -- I sure hope your test
last longer than that, too short tests are a parody, nay, a cruel joke.
The time resolution of Benchmark in user and system time depend
on the underlying system but very typically they are 1/60s.

> nothing about measuring I/O or RAM consumption.  Perhaps there
> is another game in town.

You have tried BSD::Resource?  (requires a UNIX box, though...)

> Dick

-- 
$jhi++; # http://www.iki.fi/~jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


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

Date: Mon, 13 Apr 1998 09:32:29 -0500
From: "Robert C. Rogers" <agator@imaxx.net>
Subject: Remove newline
Message-Id: <Pine.LNX.3.96.980413092639.6063A-100000@gibbon.imaxx.net>


Can someone help?

I am trying to replace "|\n" with just "|", effectively removing
the newline for those lines that end with a "|".  The code that
I am attempting to use is as follows:

#!/usr/bin/perl
while (<STDIN>){
   $tmp = <STDIN>;
   $tmp =~ s/\|\n/\|/g;
   print $tmp;
}

'taint working.  What gives?  Thanks in advance.


agator ===Z==z*<



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

Date: Mon, 13 Apr 1998 11:14:28 -0400
From: Stephen Mubita <smubit1@gl.umbc.edu>
Subject: Re: Remove newline
Message-Id: <Pine.SGI.3.96.980413111110.14225C-100000@jig.gl.umbc.edu>

On Mon, 13 Apr 1998, Robert C. Rogers wrote:

=> I am trying to replace "|\n" with just "|", effectively removing
=> the newline for those lines that end with a "|".  The code that
=> I am attempting to use is as follows:
=> 
=> #!/usr/bin/perl
=> while (<STDIN>){
=>    $tmp = <STDIN>;
=>    $tmp =~ s/\|\n/\|/g;
=>    print $tmp;
=> }
=> 

I think you are reading two lines in for each iteration: once on your
first line (<STDIN>) reads a line into the default variable, $_) and then
on the line  $tmp = <STDIN>

Try

#!/usr/bin/perl
while($tmp = <STDIN>){
 $tmp =~ s/\|\n/\|/g;
 print $tmp;
 }


Hope it helps !


--
Stephen Mubita       "All Scripture is God-breathed and is useful for
smubit1@umbc.edu      teaching, correcting, rebuking, and training in 
                      righteousness, so that the man of God may be 
                      thoroughly equipped for every good work." 
                                                  2 Timothy 3 : 16 - 17
-----------------------------------------------------------------------
        UCS is not responsible for any opinions contained here      



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

Date: 13 Apr 1998 15:20:47 GMT
From: juergen@unicorn.noris.de (Juergen Heinzl)
Subject: Re: Remove newline
Message-Id: <slrn6j4bam.m38.juergen@unicorn.noris.de>

In article <Pine.LNX.3.96.980413092639.6063A-100000@gibbon.imaxx.net>,
Robert C. Rogers wrote:
[...]
>I am trying to replace "|\n" with just "|", effectively removing
>the newline for those lines that end with a "|".  The code that
>I am attempting to use is as follows:
>
>#!/usr/bin/perl
>while (<STDIN>){
>   $tmp = <STDIN>;
>   $tmp =~ s/\|\n/\|/g;
>   print $tmp;
>}

after the while() statement you'll have already read one line and $_ will
be set. A shorter and working version is ...

#!/usr/bin/perl

while (<>) {
       s/\|\n$/\|/o;
       print;
}


Bye, Juergen

-- 
\ Real name     : Juergen Heinzl     \       no flames      /
 \ EMail Private : unicorn@noris.de   \ send money instead /
  \ Phone Private : +49 911-4501186    \                  /


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

Date: 13 Apr 1998 08:32:06 -0700
From: tzs@halcyon.com (Tim Smith)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6gtb5m$auu$1@halcyon.com>

In article <6gm3rj$gjb$1@nnrp1.dejanews.com>,  <harman@omsi.com> wrote:
> Think not only of other "programmers" but of other "users" who would use the
> software produced by those programmers.

If I release something to the public domain:

(1) Those other users are free to get it and use it.  If, say, Microsoft takes
a copy of my public domain code and puts it in something proprietary, it in
no way lessens the freedom of the public domain code.  People often point
out when arguing in favor of free software that copying software does not
harm anyone, because it does not take away from the original.  That exact
same point applies when something free is used in something non-free:  it does
not take away from the original.  (Well, if the proprietary program is so
much better than the free program, it kills user interest in the free program,
and so the developers give up, then the proprietary program could be said to
have harmed the free program, but if the free program is that easily killed,
then who cares?)

(2) If by having something free of mine in the proprietary code, the
proprietary product is improved, I have helped the users of that proprietary
product.

--Tim Smith


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

Date: Mon, 13 Apr 1998 16:48:21 -0700
From: hubert schumacher <hubert.schumacher@synapse.lu>
Subject: Run perl script as suid - C wrapper as work-around
Message-Id: <3532A445.1C8D2B55@synapse.lu>

My problem is the following: I want to run an cgi-script written in Perl

with the privileges of root, so that it can perform what it is supposed
to. This is apparently not possible and a workaround is described in
http://www.w3.org/Security/Faq/wwwsf5.html#Q50. The solution is to put a

C wrapper around, that calls the perl script, and set the C wrapper's
s-bit, so that it runs under the fileowner privileges (which is root in
this case).

The whole thing seems to work if the wrapper is run by root. But if the
wrapper is run by anyone else, I get the following message:
YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!
FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND
UNDUMP!

But this was just the sort of things the C wrapper was supposed to work
around. That's why I am confused. Does anybody have some clue, or simply

an other solution to suggest that allows me to start cgi-scripts as
root?

P.S. My configuration is the following: linux kernel 2.0.30, perl 5.003,

apache 1.3b2.


 Thanks in advance.

    Hubert





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

Date: 13 Apr 1998 08:26:29 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Run perl script as suid - C wrapper as work-around
Message-Id: <m3vhsdbv4q.fsf@windlord.Stanford.EDU>

hubert schumacher <hubert.schumacher@synapse.lu> writes:

> My problem is the following: I want to run an cgi-script written in Perl
> with the privileges of root, so that it can perform what it is supposed
> to. This is apparently not possible and a workaround is described in
> http://www.w3.org/Security/Faq/wwwsf5.html#Q50. The solution is to put a
> C wrapper around, that calls the perl script, and set the C wrapper's
> s-bit, so that it runs under the fileowner privileges (which is root in
> this case).

> The whole thing seems to work if the wrapper is run by root. But if the
> wrapper is run by anyone else, I get the following message: YOU HAVEN'T
> DISABLED SET-ID SCRIPTS IN THE KERNEL YET!  FIX YOUR KERNEL, PUT A C
> WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!

Your C wrapper isn't actually being a good wrapper.  In particular, it's
not actually changing the real user ID before execing your Perl script.
You need to find a better wrapper.

(I'm not providing one in this post because (a) it has nothing really to
do with Perl, (b) there are security issues involved in wrappers that are
non-trivial to discuss and you should look for a wrapper written by
someone who understands them rather than reinventing the wheel, and (c) I
don't actually have one handy.)

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Mon, 13 Apr 1998 09:18:51 -0600
From: antonio.m.enrique@state.ma.us
Subject: Search with "near" feature
Message-Id: <6gt6sb$r1o$1@nnrp1.dejanews.com>

I would like to add to my search engine the "near" feature, so that two words
will only be recognized if they are less than a certain number of words apart.

Any help available?
Would this feature decrease the performance?

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Mon, 13 Apr 1998 15:41:29 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Sockets, Multi-line input, and efficiency
Message-Id: <ErCzL5.B9r@world.std.com>

iqueue@panix.com (IQueue Multimedia) writes:

>I can't read the socket with a @list; it hangs if I try, and I'm assuming
>that's because it wants the entire contents of the socket, which it won't 
>get because I'm still doing transactions with it.  If it makes a difference
>to anyone, the $end_of_input_clue is the same <CR><LF>.<CR><LF> one gets
>from a POP server ending a multiline send.


Instead of reading one character at a time, you could read one line at
a time and check if the line contains ".\015\012", and push each line
onto the listor you could change the input record separator (The magic
"$/" variable) to "\015\012.\015\012", and then split the scalar
returned into a list.

-- 
Andrew Langmead


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

Date: 13 Apr 1998 15:09:44 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <6gt9ro$65j$3@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 06 Apr 1998 14:35:13 GMT and ending at
13 Apr 1998 06:09:03 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" e-mail address and name.
    - Original Content Rating (OCR) is the ratio of the original content
      volume to the total body volume.
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.

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

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

Totals
======

Posters:  461
Articles: 1121 (435 with cutlined signatures)
Threads:  373
Volume generated: 1888.3 kb
    - headers:    778.9 kb (15,405 lines)
    - bodies:     1032.0 kb (31,690 lines)
    - original:   730.7 kb (23,811 lines)
    - signatures: 76.3 kb (1,579 lines)

Original Content Rating: 0.708

Averages
========

Posts per poster: 2.4
    median: 1 post
    mode:   1 post - 291 posters
    s:      4.6 posts
Posts per thread: 3.0
    median: 2 posts
    mode:   1 post - 130 threads
    s:      3.7 posts
Message size: 1724.9 bytes
    - header:     711.5 bytes (13.7 lines)
    - body:       942.7 bytes (28.3 lines)
    - original:   667.5 bytes (21.2 lines)
    - signature:  69.7 bytes (1.4 lines)

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

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

   63    99.7 ( 51.0/ 41.2/ 27.9)  Tom Phoenix <rootbeer@teleport.com>
   28    49.0 ( 22.5/ 21.0/ 10.0)  abigail@fnx.com
   25    52.1 ( 21.0/ 24.5/ 13.1)  rjk@coos.dartmouth.edu
   23    36.3 ( 12.3/ 23.9/ 18.4)  mjd@op.net (Mark-Jason Dominus)
   22    25.9 ( 15.1/ 10.5/  5.4)  jgloudon@bbn.com
   22    34.1 ( 11.0/ 22.8/ 17.1)  aml@world.std.com (Andrew M. Langmead)
   20    38.5 ( 14.7/ 23.8/ 11.6)  Larry Rosler <lr@hpl.hp.com>
   19    23.6 ( 11.8/ 11.8/  9.1)  Gellyfish@btinternet.com
   19    30.5 ( 12.5/ 17.9/ 11.4)  cberry@cinenet.net (Craig Berry)
   13    14.3 (  7.7/  5.8/  4.0)  Jonathan Feinberg <jdf@pobox.com>

These posters accounted for 22.7% of all articles.

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

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

  99.7 ( 51.0/ 41.2/ 27.9)     63  Tom Phoenix <rootbeer@teleport.com>
  52.1 ( 21.0/ 24.5/ 13.1)     25  rjk@coos.dartmouth.edu
  49.0 ( 22.5/ 21.0/ 10.0)     28  abigail@fnx.com
  38.5 ( 14.7/ 23.8/ 11.6)     20  Larry Rosler <lr@hpl.hp.com>
  36.3 ( 12.3/ 23.9/ 18.4)     23  mjd@op.net (Mark-Jason Dominus)
  34.1 ( 11.0/ 22.8/ 17.1)     22  aml@world.std.com (Andrew M. Langmead)
  30.5 ( 12.5/ 17.9/ 11.4)     19  cberry@cinenet.net (Craig Berry)
  30.4 (  6.0/ 22.4/ 13.9)      7  drummj@mail.mmc.org
  28.6 (  6.0/ 20.9/ 17.2)     12  Greg Bacon <gbacon@cs.uah.edu>
  25.9 ( 15.1/ 10.5/  5.4)     22  jgloudon@bbn.com

These posters accounted for 22.5% of the total volume.

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

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

0.996  (  6.7 /  6.7)     10  pudge@pobox.com (Chris Nandor)
0.993  (  8.8 /  8.9)     11  fl_aggie@thepentagon.com (I R A Aggie)
0.987  (  1.8 /  1.9)      5  "WS010" <WS010@dvvlap.be>
0.985  (  7.7 /  7.8)      5  tye@fiinix.metronet.com (Tye McQueen)
0.896  (  3.4 /  3.8)      6  Quentin Fennessy <quentin.fennessy@amd.com>
0.845  (  3.4 /  4.0)      7  stvhoof@netvision.net.il
0.826  ( 17.2 / 20.9)     12  Greg Bacon <gbacon@cs.uah.edu>
0.805  (  4.0 /  4.9)      5  bart.mediamind@tornado.be (Bart Lateur)
0.781  (  4.0 /  5.1)      5  Christian Wetzel <cnwetzel@linguistik.uni-erlangen.de>
0.775  (  9.1 / 11.8)     19  Gellyfish@btinternet.com

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

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

0.516  (  5.4 / 10.5)     22  jgloudon@bbn.com
0.512  (  2.0 /  3.9)      6  kpreid@ibm.net (Kevin Reid)
0.488  ( 11.6 / 23.8)     20  Larry Rosler <lr@hpl.hp.com>
0.476  ( 10.0 / 21.0)     28  abigail@fnx.com
0.470  (  3.7 /  7.9)      6  alecler@cam.org (Andre L.)
0.450  (  3.9 /  8.8)      7  "Creede Lambard" <fearless@io.com>
0.436  (  2.7 /  6.1)      5  MARTIN@RADIOGAGA.HARZ.DE
0.361  (  5.2 / 14.4)     10  eugene@vertical.net
0.336  (  1.0 /  2.9)      5  Justin Wills <justin@nectar.com.au>
0.237  (  1.3 /  5.3)      9  Bob Trieger <sowmaster@juicepigs.com>

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

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

   35  Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
   29  RMS should be invited to O'Reilly's "Free Software Summit"
   15  perl win 32 :  asterisk on command line
   14  Numeric validation
   13  Week of Month
   13  Looking for Polling/Voting CGI/java Script
   12  How to get only 2 decimal notation?
   12  Simple Unix Question,  ( Simple for you maybe )
   12  Packing?
   11  General Rudeness, e.g. Re: Need a web login script

These threads accounted for 14.8% of all articles.

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

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

  75.7 ( 33.4/ 38.2/ 27.1)     35  Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
  52.1 ( 24.6/ 24.8/ 14.8)     29  RMS should be invited to O'Reilly's "Free Software Summit"
  46.2 ( 10.8/ 33.3/ 20.0)     15  perl win 32 :  asterisk on command line
  26.4 (  9.2/ 15.7/ 11.6)     13  Week of Month
  21.6 (  8.0/  9.1/  5.8)     10  Strange "Modification of a read-only value attempted" error
  21.5 ( 11.6/  8.8/  5.8)     14  Numeric validation
  21.0 (  8.3/ 11.9/  6.9)     12  Simple Unix Question,  ( Simple for you maybe )
  19.7 (  8.7/  9.6/  5.0)     11  General Rudeness, e.g. Re: Need a web login script
  18.7 (  9.2/  8.0/  5.1)     12  Packing?
  18.3 (  7.0/ 10.1/  4.5)      8  How do I strip newlines from a var

These threads accounted for 17.0% of the total volume.

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

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

0.850  (  3.6/   4.2)      8  MKDIR problem
0.828  (  3.0/   3.6)      8  If "=~" means match what is doesn't match?
0.807  (  3.3/   4.0)      6  [Q] How to extract a line at a time from a $string
0.782  (  8.3/  10.6)      8  MacPerl Book Online in HTML
0.778  (  3.2/   4.1)      5  fork() and exec() example needed please...
0.769  (  4.4/   5.8)      7  File download problem in IE4.0
0.764  (  4.7/   6.2)      7  Wanted: Amoo to stop my sysadmin from whining
0.761  (  4.0/   5.3)      8  Info Regarding Perl 5.005
0.741  ( 11.6/  15.7)     13  Week of Month
0.728  (  8.3/  11.4)      5  Relevance flames considered harmful (was Re: Q: Form CGI script...)

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

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

0.517  (  5.0 /  9.6)     11  General Rudeness, e.g. Re: Need a web login script
0.510  (  1.7 /  3.4)      7  File Bug in Perl of Sun-Solaris`
0.503  (  1.7 /  3.4)      5  Multi-dimensional Array Access
0.500  (  1.1 /  2.2)      5  Obfuscated Perl: figure this one out
0.496  (  2.3 /  4.7)      6  Regular expression strangeness
0.496  (  2.7 /  5.5)      5  Any ideas, expert opinions?? about..
0.493  (  5.4 / 10.9)      6  Database sorting problem
0.443  (  4.5 / 10.1)      8  How do I strip newlines from a var
0.441  (  3.0 /  6.8)      6  running `ls $file` on a nt workstation in a search script problem?
0.342  (  2.0 /  5.8)      5  Buggy textarea using IE

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

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

      64  comp.os.linux.misc
      64  gnu.misc.discuss
      19  comp.lang.perl.modules
       8  comp.lang.perl
       5  comp.lang.smalltalk
       5  comp.lang.tcl
       4  comp.os.ms-windows.nt.misc
       4  comp.lang.pascal.delphi.misc
       4  comp.object
       4  alt.html

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

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

      16  keinanen@sci.fi (Paul Keinanen)
      16  Nathan Lebron <nl2057@cnsvax.albany.edu>
      16  kenny@kacweb.com (Kenny A. Chaffin)
      15  Mktgwkz <mktgwkz@mbox4.singnet.com.sg>
      14  dlc@fc.hp.com (Dennis Clark)
      12  Russ Allbery <rra@stanford.edu>
      12  pudge@pobox.com (Chris Nandor)
      10  ilya@math.ohio-state.edu (Ilya Zakharevich)
       9  "Mike Tellinghuisen" <mtellin@rconnect.com>
       9  kwagunt@amug.org (Bob Marley)


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

Date: 13 Apr 1998 14:16:39 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Strange "Modification of a read-only value attempted" error
Message-Id: <892476996.804637@cabal>

In <352CE125.695@boeing.com> James A Squire 312 M 193884 <james.a.squire@boeing.com> writes:

[...]

>Any other possibilities?

Passing a constent arguement into a sub e.g.

&shirly("Plucky");

Will make the parts of the @_ array read only.

Also some vars like $1 arre also read only.

--
I'm a perl programer if you need perl programing hire me. Buy easter bilbies.
Please excuse my spelling as I suffer from agraphia see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html  http://www.cm.org/ 
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: 13 Apr 1998 11:55:45 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: wc -l in perl is??????
Message-Id: <6gtci1$knr$1@monet.op.net>

In article <tmorniniErBJ9M.9wJ@netcom.com>,
Tom Mornini <tmornini@netcom.com> wrote:
>Matt Taylor (nospam@rnoc.com) wrote:
>Interesting! The "obvious" way is much faster than the "almost
>certainly faster" method. That'll teach me to make any assumptions!
>Does anyone know why this might be?
> ( $line = @array = <>  is slower than  while (<>) { $line++ }

It does the same thing as the one you thought would be slower, but it
also has to allocate alot of data on the stack, then copy it into the
array.  That takes time.


If you really want it to be fast, do it this way:

	{ local $/ = undef;
          my $file = <WHATEVER>;
          $linecount = $file =~ tr/\n//;
	}




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

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

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