[19074] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1269 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 9 11:05:40 2001

Date: Mon, 9 Jul 2001 08:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <994691109-v10-i1269@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 9 Jul 2001     Volume: 10 Number: 1269

Today's topics:
        "family tree" generator <kenneth@akerne-orchids.com>
        Array Sorting-Looping-Number Formatting <nospam@xx.com>
    Re: Array Sorting-Looping-Number Formatting (Tad McClellan)
        Better-that-Commercial-quality software... (Tim Hammerquist)
    Re: Calculating business hours between 2 dates <sb@mcasia.imperia.net>
    Re: Call Perl from VB <news@simonflack.com>
    Re: calling a PERL script from Matlab (Peter J. Acklam)
        csv file conversion and speed.. <wayne.marrison@consignia.com>
        Execution time for a script (Andrew Isherwood)
    Re: Execution time for a script (Smiley)
        extracting redirecte URLs <osass@ix.urz.uni-heidelberg.de>
        FAQ: Where can I get a list of Larry Wall witticisms? <faq@denver.pm.org>
        File properties with Perl (win32) (I'm a newbie) <banjo@chello.no>
        Just installed ActivePerl - can I get the web page to i <stumo@bigfoot.com>
        Net:POP3 please help. <lwalker@ecn.purdue.edu>
        New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: Perl vs. PHP for CGI in the long-run (Rafael Garcia-Suarez)
    Re: Perl vs. PHP for CGI in the long-run <weiss@kung.foo.at>
    Re: Perl vs. PHP for CGI in the long-run <Thomas@Baetzler.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 9 Jul 2001 16:20:26 +0200
From: "Kenneth Bruyninckx" <kenneth@akerne-orchids.com>
Subject: "family tree" generator
Message-Id: <3b49bdab$0$7108$4d4efb8e@news.be.uu.net>

Hello all,


I'm looking for a script that given a set of data can "draw" (display the
names with interconnecting lines) a tree structure.
This tree structure would be something similar to a "family tree" thing but
given the fact that I'm talking about plant hybrids it would be more
something like a binary tree structure.

Anyone now of something along these lines that I could use as a basis ?

kind regards,

Kenneth.






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

Date: Mon, 09 Jul 2001 02:26:00 -0700
From: Eric <nospam@xx.com>
Subject: Array Sorting-Looping-Number Formatting
Message-Id: <3B4978A8.9E880B6C@xx.com>

Regarding the following data file parsing and writing to a new file
script (partial code):

<snip>  #Routine stuff
my $line;
while ( defined( $line = <INFILE> ) ) 

{
	  next unless $line =~ /--.*STATUS AVAILABLE/;
	  my( $status ) = unpack 'x42 A10', $line;

	  $line = <INFILE>; # This line should start with ' LOCATION'
	  die "Line 2 of record didn't start with ' LOCATION'\n"
			unless $line =~ /^ LOC/;
        my( $addr, $price ) =
                unpack 'x10 A25 x33 A11', $line;

        $line = <INFILE>; #This line should start with ' ZIP'
        die "Line 3 of record didn't start with ' ZIP'\n"
                unless $line =~ /^ ZIP/;
        my( $bd, $sf ) = unpack 'x51 A3 x14 A4', $line;

<snip>  # Several more lines of similar parsing

	  $index = $price/$sf; # calculate the Index per sf value
        writedatafile( $status, $addr, $price, $bd, $sf, $ba, $ag, $lot,
$index );
}
### SUBROUTINE 
sub writedatafile
{
my ($status, $addr, $price, $bd, $sf, $ba, $ag, $lot, $index ) = @_;
open (FILE ,">>$datafile"); 			#open output file for append
print FILE "$R,$status,\"$addr\",$price,$sf,$bd,$ba,$lot,$ag,$index\n";
print to file
$R++;							#increment record counter
close (FILE); #close output file
}

------------
Question #1:

On some of the data file records, an unwanted Line #3 sometimes appears,
which then shifts all the other lines down & messes up the rest of the
parsing (the ZIP line becomes Line #4, etc.) Example:

Input Data File Line #3:  NEW FIN:blahblah #THIS LINE IS ONLY INCLUDED
ON SOME RECORDS
Input Data File Line #4: ZIP:blahblah #THIS IS THE ONLY DESIRED LINE
BEFORE PROCEEDING

In trying to loop past the unwanted line, I tried:  next unless $line =~
/^ ZIP/; Yes...there is a leading space before ZIP... but everything is
still whacked into die mode.  I axed out the die line and at least I
know that doesn't work either.  Will something?

Question #2:

$index = $price/$sf yields a number, but I need to have a non-decimal
place number rounded up (or down) and to print on the same .csv record
line.  I just can't figure out how to combine the printf function in the
same line with the print FILE above, or is that just not possible or the
right way to approach it?

Question #3:

I've read about the foreach & keys array functions, but am lost here out
how to integrate things to get the parsed records into an appropriate
array so that I can then sort and print them to a file by (1st Field =
$status, Alphabetic, in Ascending order) and then (2nd Field = $index,
in Descending/Reverse Numeric order).  Having a blank line print to
separate the different $status entries is most desirable.  Is this
possible or must I still do this part manually after importing the .csv
file into Excel?

Thank you very much for any solutions or suggestions.


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

Date: Mon, 9 Jul 2001 09:29:27 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Array Sorting-Looping-Number Formatting
Message-Id: <slrn9kjcdn.4p1.tadmc@tadmc26.august.net>

Eric <nospam@xx.com> wrote:
>Regarding the following data file parsing and writing to a new file
>script (partial code):


><snip>  # Several more lines of similar parsing


Is the "last line" of a record easy to identify?

If so, I would suggest using only a single input operator, accumulate
a record, then process the record when you recognize the end of the
record:

while ( $line = <INFILE> ) {
   if ( $line =~ /--.*STATUS AVAILABLE/ ) {
      my( $status ) = ...
   }
   elsif ( $line =~ /^ LOCATION/ ) {
      my( $addr, $price ) = ...
   }
   elsif ( $line =~ /^ ZIP/ ) {
      my( $bd, $sf ) = ...

      my $index = ...               # process the accumulated record
      # other processing here

      $status = $addr = $price = $bd = $sf = undef;  # clear for next record
   }
}


>open (FILE ,">>$datafile"); 			#open output file for append

You should always, yes *always*, check the return value from open():

   open (FILE ,">>$datafile") or die "could not open '$datafile'  $!";


>print FILE "$R,$status,\"$addr\",$price,$sf,$bd,$ba,$lot,$ag,$index\n";


Backslashes are yucky. You can choose alternate delimiters to make
your code easier to read:

   print FILE qq($R,$status,"$addr",$price,$sf,$bd,$ba,$lot,$ag,$index\n);

I trust that you are absolutely certain that none (except $addr) of 
those variables will ever have a comma in them?

You should really use a module that knows how to deal with CSV files...


>Question #1:
>
>On some of the data file records, an unwanted Line #3 sometimes appears,


If the line you just read isn't the one you want, then you need
to read another line, not start again at the top of the loop as
next does:

   $line = <INFILE>; #This line should start with ' ZIP'
   if ( $line !~ /^ ZIP/ ) {
      warn "Line 3 of record didn't start with ' ZIP'\n;
      $line = <INFILE>;    # so get a 4th line
   }


>Question #2:
>
>$index = $price/$sf yields a number, but I need to have a non-decimal
>place number rounded up (or down) and to print on the same .csv record
>line.  

          my $index = sprintf "%.0f", $price/$sf;


>I just can't figure out how to combine the printf function in the
>same line with the print FILE above, or is that just not possible or the
>right way to approach it?


You do not need to combine them  :-)


>Question #3:
>
>I've read about the foreach & keys array functions, 


keys() is NOT an "array function".

keys() operates on hashes, not arrays.


>but am lost here out
>how to integrate things to get the parsed records into an appropriate
>array so that I can then sort and print them to a file 


Instead of outputting each line, push it into an LoL (perldoc perllol)
data structure. Sort and print from the LoL after finishing with the 
<INFILE> while loop.

ie. instead of: writedatafile( $status, $add...)

   push @records, [ $status, $add... ];  # push an anon array

Even better, use a LoH (perldoc perldsc) instead of a bunch of
individually named scalars:


   my @records;  # a list of hashes
   my %rec;      # a single record, encapsulated in a hash

   while ( $line = <INFILE> ) {
      if ( $line =~ /--.*STATUS AVAILABLE/ ) {
         $rec{status} = ...
      }
      elsif ( $line =~ /^ LOCATION/ ) {
         @rec{ 'addr', 'price' } = ...  # a "hash slice"
      }
      elsif ( $line =~ /^ ZIP/ ) {
         @rec{ qw(bd sf) } = ...        # another hash slice

         $rec{index} = ...              # process the accumulated record
         push @records, { %rec };       # copy and remember the record
         %rec = ()                      # clear for next record
   }


>by (1st Field =
>$status, Alphabetic, in Ascending order) and then (2nd Field = $index,
>in Descending/Reverse Numeric order).


Start with the Schwartzian Transform given in the Perl FAQ:

    @sorted = map  { $_->[0] }
              sort { $a->[1] cmp $b->[1] }
              map  { [ $_, uc( (/\d+\s*(\S+)/)[0]) ] } @data;

Then modify it for your situation. Let's remove all the "other stuff"
you are doing so just the "sorting part" will be easier to see.

Here is a complete program that sorts a LoH in the manner you 
have requested:

----------------------
#!/usr/bin/perl -w
use strict;

my @records = (
   { status => 'status4', index => 4 },
   { status => 'status1', index => 10 },
   { status => 'status3', index => 3 },
   { status => 'status1', index => 1 },
   { status => 'status2', index => 2 },
   { status => 'status3', index => 1 },
   { status => 'status1', index => 12 },
   { status => 'status3', index => 10 },
);


my @sorted = map  { $_->[0] }
             sort { $a->[1] cmp $b->[1] or
                    $b->[2] <=> $a->[2]
                  }
             map  { [ $_, $_->{status}, $_->{index} ] } @records;

print "$_->{status}    $_->{index}\n" for @sorted;
----------------------



-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Mon, 09 Jul 2001 07:55:59 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Better-that-Commercial-quality software...
Message-Id: <slrn9kipj2.2oc.tim@vegeta.ath.cx>

A while back there was a poster who was advertising his product.

This product boasted the ability to fetch _part_ of an HTML page from
another site and include it (via SSI, etc.) in _your_ personal site.

I actually got the script, was very disappointed in it, and decided to
write my own version.  This is still not a priceless piece of code, but
may be worth something to someone.

Anyway, if anyone is interested in this copylefted software, it is
availabe at:
    http://dichosoft.com/perl/FreeRipper.tar.gz

Part of the included README file reads:

: Thank you for downloading FreeRipper v1.0.  FreeRipper allows you to
: fetch and use HTML from other web sites directly on your site.  You
: simply supply the URL and the starting and ending points to start fetching
: in minutes
: 
: Advantages of FreeRipper over similar scripts (such as PageRipper at
: http://pageripper.cjb.net):
:     - FreeRipper was written by someone who actually knows Perl.
:     - FreeRipper is compatible with mod_perl and 'use strict'
:     - FreeRipper doesn't go through the trouble of reading, parsing, and
: processing POST data (that isn't there) and then never even _attempt_ to use
: it.
:     - FreeRipper doesn't have numerous pointless page-wide regex substitutions
: that would be unnecessary had the author any idea of how to use regex's.
:     - FreeRipper doesn't bullshit you and say that removal of the pathetic
: link back to the script's home will break the script.  As a matter of fact,
: there _is_ no extra output with FreeRipper!
: 
: This copylefted script may be duplicated and sold without or without written
: permission from anyone. 

-- 
-Tim Hammerquist <timmy@cpan.org>
You know, we've got armadillos in our trousers.
It's really quite frightening.
    -- Nigel Tufnel, "This is Spinal Tap"


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

Date: Mon, 9 Jul 2001 12:30:40 +0200
From: Steffen Beyer <sb@mcasia.imperia.net>
Subject: Re: Calculating business hours between 2 dates
Message-Id: <g41ci9.1pu.ln@imperia.net>

Bart Lateur <bart.lateur@skynet.be> wrote:

> Alan J. Flavell wrote:
> 
>>With respect, the FAQ is only the easy part of the hon.
>>Usenaut's actual question.  (And we don't seem to have heard
>>what we're supposed to do about public holidays yet...).
> 
> Public holidays aren't business hours.
> 
> One possibility is to use the Date::Calc module. If you look at the last
> example in the docs as per CPAN, you'll see code to calculate the 
> difference between dates excluding saturdays and sundays. That's a
> start. And IIRC, Steffen Beyer is working on a check to see if a day is
> a holiday, though the online docs don't mention it.

The oncoming new version 5.0 of Date::Calc (which is going to be released
real soon now) is capable of handling public holidays for a wide range of
countries and federal states (it provides profiles you can use, or you
can easily provide your own).

See http://www.engelschall.com/u/sb/download/pkg/Date-Calc-5.0.tar.gz
for a pre-release (not final yet).

However, it only handles business _days_, not business _hours_.

But you might use it as a start:

You can tell the module whether is shall include or exclude the
starting and the final date.

In your case you'd exclude both, and calculate the difference in
business _hours_ for the start date and the end date yourself, and
add these to the value returned by the module times 24.

Anyway, if I'm not mistaken, the Date::Manip module on CPAN is capable
of handling business _hours_, and I think you can freely define your
own business hours in a configuration file.

Hope this helps!

> I've hardly ever used the module myself, so I'm not in on the dirty details.
                                                                ^^^^^
I heard that! ;-)

Yours,
-- 
    Steffen Beyer <sb@engelschall.com>
    (This message may not be replyable. Use address on line above instead!)
    http://www.engelschall.com/u/sb/whoami/ (Who am I)
    http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
    http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)


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

Date: Mon, 9 Jul 2001 12:24:37 +0100
From: "Simon Flack" <news@simonflack.com>
Subject: Re: Call Perl from VB
Message-Id: <9ic4np$hon3b$1@ID-83895.news.dfncis.de>

> > > anyone know if i can call perl prog from VB?

> You can probably get somewhere by using PerlCtrl or PerlCOM (or
> something like that) to turn your Perl script into an ActiveX control or
> a COM object that you can manipulate from VB. They're payware from
> ActiveState.

You can also turn your perl script into a windows script component using
ActivePerl. This uses the windows script host. There is some documentation
on this in the activeperl dist. This is freeware, but not as portable.

Simon


"Philip Newton" <pne-news-20010709@newton.digitalspace.net> wrote in message
news:fdjikt4tm086vga4ooq6aibqk6mq6i4607@4ax.com...
> On Mon, 09 Jul 2001 05:26:20 GMT, tim@vegeta.ath.cx (Tim Hammerquist)
> wrote:
>
> > keng <keng@spinalfluid.com> wrote:
> > > anyone know if i can call perl prog from VB?
> >
> > If you mean calling a Perl script from a VB app, I'm not sure.  You
> > probably want to ask a VB person what you can do in this case.
>
> You can probably get somewhere by using PerlCtrl or PerlCOM (or
> something like that) to turn your Perl script into an ActiveX control or
> a COM object that you can manipulate from VB. They're payware from
> ActiveState.
>
> Cheers,
> Philip
> --
> Philip Newton <nospam.newton@gmx.li>
> That really is my address; no need to remove anything to reply.
> If you're not part of the solution, you're part of the precipitate.




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

Date: 09 Jul 2001 11:55:36 +0200
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: calling a PERL script from Matlab
Message-Id: <wkr8vqe8jq.fsf@math.uio.no>

Patrick Menter <pmenter@bignet.net> wrote:

> Just use the callperl command in matlab 6.0.

Huh?

   >> disp(version)
   6.0.0.88 (R12)
   >> which callperl -all
   callperl not found.

Peter

-- 
~/.signature: No such file or directory


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

Date: Mon, 9 Jul 2001 14:57:40 +0100
From: "Wayne Marrison" <wayne.marrison@consignia.com>
Subject: csv file conversion and speed..
Message-Id: <994687021.266653@igateway.postoffice.co.uk>

Dear all,

I have a file (well, many acutally) that contain in excess of 100k lines in
each.

The file is standard CSV format (quoted strings, bare numbers & dates
(dd/mm/yy)) that is fairly easy to parse using the examples to be found in
the FAQ.

The problem is ... that using a combination of sed/awk on the same set of
files rather than perl, takes approx 2./3'ds of the time.

I have to parse the lines out of the file using a unique field seperator (Im
currently using ^] as a field delimiter) to retain the commas within the
quoted fields.

The way the data is presented, its easy to change "," & ", to the unique
seperator, and then read in the line, modifiying the old field seperator (,)
between the dates & numbers (as they now appear to be one field, so I can
split it down using the perl split function) to the unique field seperator
and write them back to disk.

Later on, another script can read the converted file using the unique field
splitter as a delimiter.

(forgive the poor description.. heres an example)...

Raw
"A","123, somewhere street","anywhere",123.80,12/6/99,400.78,341.09,31/5/00

After Initial Conversion
A^]123,somewhere street^]anywhere^]123.80,12/6/99,400.78,341.09,31/5/00

The numbers at the end appear to be 1 complete field .. i.e.

123.80,12/6/99,400.78,341.09,31/5/00

I can then convert the , to ^] and write it back to the file.....

The only problem here, as I stated above is that it takes much longer to do
this in Perl than the equivalent sed/awk.  And as the perl used to do the
parsing is straight out of the FAQ, Im at a bit of a loss on how to speed it
up.

I have written a routine that uses sysread/write & tr to perform most of the
operations, but I would still have to run through the file line by line
afterwards and do the final conversion of the commas.

Any help here would be appreciated...

Thanks

Wayne





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

Date: Mon, 09 Jul 2001 13:58:00 GMT
From: andy_isherwood@hotmail.com (Andrew Isherwood)
Subject: Execution time for a script
Message-Id: <3b49b812.423579134@news.aber.ac.uk>

Could someone please tell me the easiest way of getting the execution
time for a script. I'd like to assign this to a variable.

Many thanks
Andrew


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

Date: Mon, 09 Jul 2001 17:10:53 GMT
From: gurm@intrasof.com (Smiley)
Subject: Re: Execution time for a script
Message-Id: <3b49e428.141254933@news1.on.sympatico.ca>

Well, the very easiest way would be something like this:

my $exec_time = localtime(time);

Of course, this gives you a big string including the date, month,
year, and weekday as well.  If you don't want the extra stuff and just
want the time of day, do this:

my @time = localtime(time);
my $exec_time = "$time[2]:$time[1]:$time[0]";

Does that help?


On Mon, 09 Jul 2001 13:58:00 GMT, andy_isherwood@hotmail.com (Andrew
Isherwood) wrote:

>Could someone please tell me the easiest way of getting the execution
>time for a script. I'd like to assign this to a variable.
>
>Many thanks
>Andrew



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

Date: Mon, 9 Jul 2001 13:16:33 +0200
From: Oliver Sass <osass@ix.urz.uni-heidelberg.de>
Subject: extracting redirecte URLs
Message-Id: <9ic3qi$ish$2@news.urz.uni-heidelberg.de>

Dear Readers!
I am currently working on a small meta-searchengine for library-requests on 
base of html-forms/cgi-requests and LWP-Agents.
Unfortunatly, one of the libraries had the strange (to me) idea, to 
redirect requests to special TCP/IP Ports:
When I make a get-request on the html-forms-URL, the server redirects me to 
an exotic port (like www.example.edu/forms.html:40153). I can make my 
cgi-request only on this port, and the server listens on that port only for 
about ten minutes, and I have to get new "ports" (or sessions) for every 
new request...
So, my problem is: how can I get the redirected URL, in order to do my 
requests dynamicly on these redirected URLs?
I would be very glad to get an answer!
Greetings,
Oliver
-- 
## Oliver
## sass@gw.sino.uni-heidelberg.de
## Heidelberg, Germany


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

Date: Mon, 09 Jul 2001 12:17:02 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: Where can I get a list of Larry Wall witticisms?
Message-Id: <2hh27.76$T3.200270336@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  Where can I get a list of Larry Wall witticisms?

    Over a hundred quips by Larry, from postings of his or source code, can
    be found at http://www.perl.com/CPAN/misc/lwall-quotes.txt.gz .

    Newer examples can be found by perusing Larry's postings:

        http://x1.dejanews.com/dnquery.xp?QRY=*&DBS=2&ST=PS&defaultOp=AND&LNG=ALL&format=terse&showsort=date&maxhits=100&subjects=&groups=&authors=larry@*wall.org&fromdate=&todate=

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           01.14
-- 
    This space intentionally left blank


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

Date: Mon, 9 Jul 2001 16:40:38 +0200
From: "Kjetil Furnes" <banjo@chello.no>
Subject: File properties with Perl (win32) (I'm a newbie)
Message-Id: <9icfol$en2$1@stockholm.tele1europe.no>

I'm having problems separating the files in a folder.
The goal is to delete the files (unlink ?) when they are three days or
older.

But I can't seem to separate the files by either modification date (-M),
file size (-S), creation date
(-C) or wether they are real or not (-F)

I either get all files (in no particular order) or no files what so ever.
I'll send an example of one of the scripts. This one lists all the files,
but claims they all have a filesize of zero. ???


opendir (TMPFILES, "C:/Temp");
@files = readdir(TMPFILES);
closedir (TMPFILES);

foreach $f (@files) {
 $i{$f} = -S $f };
foreach $k (sort{ $i{$b} <=> $i{$a} } keys %i )
{printf "%8d %s\n", $i{$k}, $k };



I have tried many ways to sort or print on either modification date or size,
but without result.. :-(

It must be something silly, I hope :-)

Thnx in advance
<NEWBIE>




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

Date: Mon, 9 Jul 2001 14:54:50 +0100
From: "Stuart Moore" <stumo@bigfoot.com>
Subject: Just installed ActivePerl - can I get the web page to include the module docs?
Message-Id: <FLi27.15910$B56.2734862@news2-win.server.ntlworld.com>

Just installed the new version of ActivePerl over a previous one where I'd
installed a lot of modules using PPM. I liked the way that PPM included the
module in the list of modules with the documentation of ActivePerl, so it was
easy to find the documentation. The reinstall has overwritten these - is there a
simple way to update the html pages without having to reinstall everything?

Cheers

Stuart




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

Date: Mon, 9 Jul 2001 03:34:52 -0500
From: Laron Andrion Walker <lwalker@ecn.purdue.edu>
Subject: Net:POP3 please help.
Message-Id: <Pine.GSO.4.33.0107090333110.21104-100000@min.ecn.purdue.edu>

Hello, does anyone know why I can't get the follwing code to return the
number of new and total messeges in a pop3 mailbox...


@mes=$pop3->ping('lwalker');

print "\nyou have $mes[0] new messages\n";
print "\n you have $mes[1] total messages"


Thanks,

Laron



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

Date: Mon, 09 Jul 2001 14:38:44 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <tkjgfkb8j4st24@corp.supernews.com>

Following is a summary of articles from new posters spanning a 7 day
period, beginning at 02 Jul 2001 15:39:29 GMT and ending at
09 Jul 2001 13:17:02 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) 2001 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

Totals
======

Posters:  118 (36.5% of all posters)
Articles: 212 (23.1% of all articles)
Volume generated: 343.7 kb (21.0% of total volume)
    - headers:    162.5 kb (3,399 lines)
    - bodies:     176.8 kb (6,110 lines)
    - original:   113.2 kb (4,105 lines)
    - signatures: 4.2 kb (76 lines)

Original Content Rating: 0.640

Averages
========

Posts per poster: 1.8
    median: 1.0 post
    mode:   1 post - 77 posters
    s:      5.5 posts
Message size: 1660.3 bytes
    - header:     784.7 bytes (16.0 lines)
    - body:       854.1 bytes (28.8 lines)
    - original:   546.9 bytes (19.4 lines)
    - signature:  20.5 bytes (0.4 lines)

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

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

   16    29.3 ( 10.3/ 16.0/  3.5)  dbe@todbe.com
    7     8.8 (  6.3/  2.5/  1.6)  "Tom Melly" <tom.melly@ccl.com>
    7     5.3 (  3.5/  1.8/  1.7)  Alexvalara <alexvalara@aol.com>
    6     8.2 (  4.3/  3.8/  2.3)  "Emil Horowitz" <mail@nexo.de>
    6    14.7 (  3.7/ 11.0/  8.4)  William Pietri <william-news-102374@scissor.com>
    5    10.2 (  4.0/  6.2/  2.6)  Smiley <gurm@intrasof.com>
    4     6.9 (  3.0/  3.9/  0.9)  "Jim McTiernan" <james.mctiernan@rcn.com>
    4     4.9 (  2.8/  2.0/  0.7)  "Trevor Ward" <trevor.r.ward@blueyonder.co.uk>
    4    16.1 (  3.7/ 12.4/  5.5)  "The Crystal Ball Inc." <shop@wehug.com>
    4     5.3 (  2.7/  2.6/  1.5)  sjaniska@inet.hr

These posters accounted for 6.9% of all articles.

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

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

  29.3 ( 10.3/ 16.0/  3.5)     16  dbe@todbe.com
  16.1 (  3.7/ 12.4/  5.5)      4  "The Crystal Ball Inc." <shop@wehug.com>
  14.7 (  3.7/ 11.0/  8.4)      6  William Pietri <william-news-102374@scissor.com>
  10.2 (  4.0/  6.2/  2.6)      5  Smiley <gurm@intrasof.com>
   8.8 (  6.3/  2.5/  1.6)      7  "Tom Melly" <tom.melly@ccl.com>
   8.4 (  3.0/  5.4/  4.2)      4  chris@wmccmsvr.ssr.hp.com
   8.2 (  4.3/  3.8/  2.3)      6  "Emil Horowitz" <mail@nexo.de>
   6.9 (  3.0/  3.9/  0.9)      4  "Jim McTiernan" <james.mctiernan@rcn.com>
   6.8 (  3.6/  3.2/  2.2)      4  "Buck Turgidson" <jc_va@spamisnotcool.hotmail.com>
   5.9 (  2.7/  3.2/  1.5)      3  Dominic Mitchell <dommit@videotron.ca>

These posters accounted for 7.0% of the total volume.

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

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

1.000  (  2.5 /  2.5)      3  "Robin Abrol" <newsman@-takethisout-brol.org.uk>
0.950  (  1.7 /  1.8)      7  Alexvalara <alexvalara@aol.com>
0.857  (  2.2 /  2.5)      3  Steve Miller <steveaux@my-deja.com>
0.780  (  4.2 /  5.4)      4  chris@wmccmsvr.ssr.hp.com
0.765  (  8.4 / 11.0)      6  William Pietri <william-news-102374@scissor.com>
0.696  (  2.2 /  3.2)      4  "Buck Turgidson" <jc_va@spamisnotcool.hotmail.com>
0.615  (  1.6 /  2.5)      7  "Tom Melly" <tom.melly@ccl.com>
0.591  (  1.5 /  2.6)      4  sjaniska@inet.hr
0.589  (  2.3 /  3.8)      6  "Emil Horowitz" <mail@nexo.de>
0.469  (  1.5 /  3.2)      3  Dominic Mitchell <dommit@videotron.ca>

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

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

0.589  (  2.3 /  3.8)      6  "Emil Horowitz" <mail@nexo.de>
0.469  (  1.5 /  3.2)      3  Dominic Mitchell <dommit@videotron.ca>
0.460  (  1.1 /  2.3)      3  Luis <loboaguia@yahoo.com>
0.458  (  0.5 /  1.1)      3  "Tro" <dmitriv_rus@hotmail.com>
0.446  (  5.5 / 12.4)      4  "The Crystal Ball Inc." <shop@wehug.com>
0.429  (  2.6 /  6.2)      5  Smiley <gurm@intrasof.com>
0.356  (  0.5 /  1.5)      3  "J.D. Fieldsend" <u9jdf@csc.liv.ac.uk>
0.345  (  0.7 /  2.0)      4  "Trevor Ward" <trevor.r.ward@blueyonder.co.uk>
0.240  (  0.9 /  3.9)      4  "Jim McTiernan" <james.mctiernan@rcn.com>
0.219  (  3.5 / 16.0)     16  dbe@todbe.com

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

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

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

      29  comp.lang.perl.modules
      25  alt.perl
      12  alt.romance.chat
      12  rec.music.artists.stevie-nicks
      10  comp.lang.perl
       7  comp.soft-sys.matlab
       6  comp.lang.perl.moderated
       3  mailing.database.mysql
       3  alt.comp.lang.learn.c-c++
       3  alt.comp

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

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

      21  Damien Doligez <damien.doligez@inria.fr>
       7  "Sebastijan Vacun" <sebastijan.vacun@uni-mb.si>
       6  3819@C208.33.61.34
       4  jwalker@warwick.net
       4  ancientorder1@nocrap.home.com
       3  Steve Miller <steveaux@my-deja.com>
       3  James Ross <J.G.Ross@warwick.ac.uk>
       3  "noms" <dont@mail.me>
       3  "Mark Dudley" <pen411@home.com>
       3  "Flag FComo" <flag@como.com>


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

Date: 9 Jul 2001 07:45:59 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Perl vs. PHP for CGI in the long-run
Message-Id: <slrn9kioae.2r0.rgarciasuarez@rafael.kazibao.net>

R. Eranki wrote in comp.lang.perl.misc:
} 'lo all.
} 
} What do you guys think of the future of Perl as a CGI language? I've
} used Perl for a while, and have been (unfortunately) using PHP more
} recently, simply because it's fast (although mod_perl should be only
} slightly slower, correct?).

You mean probably a web programming language. PHP is often used as an
apache module, thus not as an interpreter for CGI programs. Neither are
mod_perl applications CGI programs.

} Now, I'm writing some free forums for the hell of it, and I've started
} in PHP, but I'm getting terribly frustrated when I'd like to do
} something similar to Perl (At least C global scope, for cryin' out
} loud!). How can I convince myself to use Perl?

IMHO, using Perl will lead to more maintainable, more portable and more
secure code. Perl is much more mature than PHP. PHP lacks several useful
language features : namespaces (modules), "strong" typing (à la Perl),
etc. And, PHP is oriented to be very easy to start with -- unfortunately
this also makes it easy to introduce bugs (including security holes).
Can I point you to a recent paper discussing vulnerabilities in PHP
applications? <http://lwn.net/2001/0704/a/study-in-scarlet.php3>.

} How long will Perl stay as a common CGI language?
} Is there any effort being made to increase Perl's performance in
} general, and with databases?

Have you tried mod_perl and persistent DB connections ?

} Heh. Sounds like a new drug. "I do PHP because all my friends do it!"

Yes. You know, PHP is good at some things. You can program an hybrid
application ;-)

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Mon, 9 Jul 2001 10:53:49 +0200
From: "Stefan Weiss" <weiss@kung.foo.at>
Subject: Re: Perl vs. PHP for CGI in the long-run
Message-Id: <3b49709c$1@e-post.inode.at>

"Rafael Garcia-Suarez" <rgarciasuarez@free.fr> wrote:
> R. Eranki wrote in comp.lang.perl.misc:

> } Heh. Sounds like a new drug. "I do PHP because all my friends do it!"

Be careful. PHP abuse can really get you in trouble:
http://bbspot.com/News/2000/6/php_suspend.html

stefan




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

Date: Mon, 09 Jul 2001 12:33:35 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Perl vs. PHP for CGI in the long-run
Message-Id: <3t1jktc0fqe1absrc13prten28hrg9ie26@4ax.com>

On Mon, 09 Jul 2001, "R. Eranki" <pr_NOSPAM_lx@m*NOSPAM*ac.com> wrote:
>What do you guys think of the future of Perl as a CGI language? I've
>used Perl for a while, and have been (unfortunately) using PHP more
>recently, simply because it's fast (although mod_perl should be only
>slightly slower, correct?).

Is there a particular reason why you don't use both for whatever they
do best? I prefer PHP for frontend stuff (i.e. where the HTML matters)
and Perl whenever I need to do something that needs a bit of logic.

HTH,
-- 
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 1269
***************************************


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