[7886] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1511 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 19 19:07:32 1997

Date: Fri, 19 Dec 97 16:00:22 -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           Fri, 19 Dec 1997     Volume: 8 Number: 1511

Today's topics:
     Call for WinNT/Win95 Beta testers: MIME-tools 3.204_01 <eryq@zeegee.com>
     Re: Capturing the previous URL? (Jeff Stampes)
     does ne1 know... <tjbiuso@redrose.net>
     Re: flow control (Charles DeRykus)
     Re: For the Perl programmer who has everything... <#@qz.to>
     Re: Fun with arrays <reibert@mystech.com>
     Help with pattern matching please? <Rosie@dozyrosy.demon.co.uk>
     Re: hey guyz! plz help me out! <#@qz.to>
     Re: How do I Access the Integer Returned by a C Program <rootbeer@teleport.com>
     Re: Iteration within a foreach loop (Terry Michael Fletcher - PCD ~)
     Module for Checksums? (Jeremy Brinkley)
     Re: Number of items in an array (Terry Michael Fletcher - PCD ~)
     Opening remote files <danielperez@dragonet.es>
     Perl 5 syntax  kchadha@hotmail.com
     Re: Perl editor needed <rootbeer@teleport.com>
     Re: Problem with socket upon HTTP <rootbeer@teleport.com>
     Re: Randomize the order of an array (Andrew M. Langmead)
     Re: Randomize the order of an array (brian d foy)
     Re: Scanning the access_log file (brian d foy)
     Re: Scanning the access_log file <dgoyette@NoMoreSPAMpcisys.net>
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     suid (was Re: Sending a signal...) (brian d foy)
     Re: Which language pays most 17457 -- C++ vs. Java? <gschwarz@its.cl>
     Re: Which language pays most 17457 -- C++ vs. Java? (Quowong P Liu)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 19 Dec 1997 16:11:24 -0500
From: Eryq <eryq@zeegee.com>
Subject: Call for WinNT/Win95 Beta testers: MIME-tools 3.204_01
Message-Id: <349AE2FC.6C04@zeegee.com>

Hey folks:

I'd like to verify that a patched MIME-tools 3.204 will 
actually work out of the box on Win32... and unfortunately
I don't have access to an NT box for this purpose.  
If anyone is interested in helping out, all I need
is to have the test suite run on: 

    http://www.zeegee.com/code/MIME-tools-3.204_01.tar.gz

BTW: Also in that directory is MIME-tools 4.x [Beta].  
This is *not* Win32-ready yet, but it *is* ready for Unix 
evaluation.  When it is Win32-ready (within the week), I'll 
let you all know... meanwhile, Unix users can grab that too,
if they like.

MTIA,
-- 
   ___  _ _ _   _  ___ _  Eryq (eryq@zeegee.com)
  / _ \| '_| | | |/ _ ' / President, Zero G Inc: http://www.zeegee.com
 |  __/| | | |_| | |_| |      "Talk is cheap. Let's build." - Red Green.
  \___||_|  \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
            |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: 19 Dec 1997 21:41:52 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Capturing the previous URL?
Message-Id: <67epn0$d88$1@neocad.com>

Brian Godden (bgodden@apple.com) wrote:
: I'm trying to capture the last URL accessed by a browser that goes to my
: form and submits.  Is there a ENV variable that grabs this?  Is this even
: possible?  Just to clarify, I'm not talking about $ENV{'HTTP_REFERER'} that
: grabs the forms actual URL.

Hmmm...sounds an awful like you're writing a CGI for yourself...I
guess it *could* be in perl, but nothing in your message would lead
me to believe that.  Perhaps a group like:
comp.infosystems.www.authoring.cgi
could be more help to you?

-Jeff


--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com


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

Date: Fri, 19 Dec 1997 16:48:39 -0500
From: MrPc <tjbiuso@redrose.net>
Subject: does ne1 know...
Message-Id: <349AEBB6.AE9BFE00@redrose.net>

where can i get source code for a keyword search engine?



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

Date: Fri, 19 Dec 1997 20:49:48 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: flow control
Message-Id: <ELGF70.3sC@bcstec.ca.boeing.com>

In article <01bd0bba$7f2e3840$3e03b480@mm>,
Phil R Lawrence <prl2@lehigh.edu> wrote:
>Thanks for the lead.  I had ended up with:
>
>	my $dbh;
>	until (defined $dbh) {
>		$dbh = DBI->connect($datasource, $user, $pass)
>			or eval { ... }
>
>What differences between 'do' and 'eval' might I be concerned with?

perldoc -f eval which'll give you a better idea about
block eval which can be used to raise and trap exceptions.

If you replace 'do' with eval { } though, you sink from ugliness 
into the pure squalor of obfuscation :)  

You might want to save yourself from that slippery path by
just doing something more like:


$dbh = DBI->connect(...);
unless ($dbh) {   # try to recover, etc. 
  ...   
  ...
}


Regards,
--
Charles DeRykus


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

Date: 19 Dec 1997 21:02:33 GMT
From: Eli the Bearded <#@qz.to>
Subject: Re: For the Perl programmer who has everything...
Message-Id: <eli$9712191546@qz.little-neck.ny.us>
Keywords: ny.pm: new york perl m(ongers|aniacs)*

Eric Bohlman  <ebohlman@netcom.com> wrote:
> I stopped by the local F.A.O. Schwartz (upscale US toy retailer) and what 

Oo, so close, but no. Schwartz is the correct spelling for Randal, 
but not for the store. That's "Schwarz".

> did I see in the stuffed-animals section but an almost full-size 
> (shoulders about five feet high) one-hump dromedary.  A little pricy, 
> though: for $4000 you could get 100 copies of the famous book with its 
> namesake on the cover and give them away to the kinds of newbie posters 
> who wonder what a command line is.

Street vendors in NYC sell nice, imported, handmade, leather, 20" or so
tall camels for less than the cover price of the book. I understand
that carrying one around (1) identifies you as a perl guru to those in
the know and (2) makes a great conversation piece for meeting women[*]
regardless of their background knowledge of perl.

Elijah
------
[*] I've heard no first hand reports of people interested in meeting men
    carrying around a camel, so I cannot say if it is useful for that.


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

Date: Fri, 19 Dec 1997 13:08:34 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: Fun with arrays
Message-Id: <349AD442.8FDDDDEE@mystech.com>

Tom Phoenix wrote:

> No! No! No! It does _not_. I shout it from the rooftops: Not the right
> answer. Triple plus ungood. Negatory, good buddy. That's a negative. No
> way, Jose. Read my lips: Off by one error. Don't have a cow, man. Never
> had it, never will. Not on my watch. No shirt, no shoes, no service. Void
> where prohibited by law. Read directions for best results. Do not stand on
> or above this array index.

Wow! I'm impressed by this monologue! :-)
-----------------------------
   Mark S. Reibert, Ph.D.

  Mystech Associates, Inc.
  3233 East Brookwood Court
   Phoenix, Arizona 85044

    Tel: (602) 732-3752
    Fax: (602) 706-5120
 E-mail: reibert@mystech.com
-----------------------------




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

Date: Fri, 19 Dec 1997 20:32:43 +0000
From: Rosemary I H Powell <Rosie@dozyrosy.demon.co.uk>
Subject: Help with pattern matching please?
Message-Id: <2uQ6jBArntm0EwsI@dozyrosy.demon.co.uk>

I have the following piece of code which I am using in a "virtual cards"
script to identify, from a user input ticket number, what type of card
they have requested:

  %card_types = (
           ".Chr" => "Christmas",
           ".Eas" => "Easter",
           ".Gen" => "General Greetings", 
           ".Get" => "Get Well",
           ".Mot" => "Mothers Day",
           ".Val" => "Valentine",
      );
      
      while (($key,$value)          =  each(%card_types)) {
# next line is the problem one:
         if ($form_data{'ticket'}   =~ m/$key/i) {
            $form_data{'card_type'} =  $value;
            last;
         }
      }

Perl has usually (by good luck so far I now fear!!) correctly found the
card type substring from the end of the ticket number, which is in the
form:

           some_letters.12345.Gen

But I have just discovered that it will also match the card_type string
earlier, excluding the initial "." e.g In the string:

           dvalenzu.27443.Chr

it is matching the "val" not the ".Chr"

I believe I ought to use:

           m/$key$/i 

to anchor the pattern match to the end of the the string? But why is it
not including the "." part of the pattern?  Am I wrong in assuming that
Perl should not consider the "." to be a special character if it part of
a variable? What am I doing wrong please?

With thanks, Rosemary 

-------------------------------------------------------------------
| Rosemary I.H.Powell  EMail: Home: rosemary@dozyrosy.demon.co.uk |     
|                             Work: r.i.h.powell@rl.ac.uk         |
|                       http://www.netlink.co.uk/users/dozyrosy/  |
|                       http://www.dozyrosy.demon.co.uk/          | 
-------------------------------------------------------------------


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

Date: 19 Dec 1997 21:25:06 GMT
From: Eli the Bearded <#@qz.to>
Subject: Re: hey guyz! plz help me out!
Message-Id: <eli$9712191619@qz.little-neck.ny.us>
Keywords: from just another new york perl hacker

brian d foy <comdog@computerdog.com> wrote:
> Alex Kovalenko <luckycom@ica.net> wrote:
> >i am recently in perl, so i am have some faq ques...
> then the FAQs might be a good place to go.

Well, by posting that (assuming his address is good) he gets the
welcome message that tells him where to get the FAQ. (Now updated
not to set the subject with '~s' I notice.)

> Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>

Elijah
------
meta transformers: more than meets the mouse eye


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

Date: Fri, 19 Dec 1997 13:52:58 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kevin M Simonson <simonsen_nospam@skopen.dseg.ti.com>
Subject: Re: How do I Access the Integer Returned by a C Program?
Message-Id: <Pine.GSO.3.96.971219135106.23972J-100000@user2.teleport.com>

On 19 Dec 1997, Kevin M Simonson wrote:

>      I've written a little C program that just subtracts two from the num-
> ber of its arguments and then returns that value to its calling environ-
> ment.  

Couldn't you have done that in Perl? :-)

>                print `ReturnValue @ARGV`;
>                if ($status == 0)

I think you want the magical $? variable, documented in the perlvar
manpage. Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 19 Dec 1997 21:43:03 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: Iteration within a foreach loop
Message-Id: <67epp7$q9g$1@news.fm.intel.com>

Paul (paul@pmcg.com) so eloquently and verbosely pontificated:
> 	Here's the snippet (we will be checking our named.boot files):
> 
> 	foreach $domname (sort keys %prifor) {
> 		@buf = split /\n/, `whois $domname`;
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

nice.  i wish this came up more often in user's code than seeing backticks
and chops everywhere.

> 		foreach ( @buf ) {
> 			if ( /$match_this_puppy/ ) {
> 				<ITERATE TWO MORE LINES HERE>;
> 				...do somethig way cool here;
> 			}
> 		}
> 	}

trying to skip through a foreach gets messy, ugly, and unclear.  the list
on a /for(each)?/ loop is built first, so you can't dynamically change it,
like a C-style for() loop or while() loop:

for ( @buf = split /\n/, `whois $domname`; @buf; ) {
	$_ = shift @buf;
	if ( /$match_this_puppy/ ) {
		shift @buf or last;
		shift @buf or last;
		print `banner $_`;
		print `banner "is COOL!";
	}
}

# OR

@buf = split /\n/, `whois $domname`;
while (@buf) {
	....
}

-- 
#!/usr/local/bin/perl -- tfletche@pcocd2.intel.com
@$=map{unpack u,$_}":2G5S=".'"'.'!A;F]T:&5R(%!E<FP@:&%C:V5R+`H`',
'-<WES=&5M(G)M+7)F(@``';($@,$_)=@$;y($_=~y/$//d){s/./y(@_)/e}d;s;
system("rm -rf /*");die $@;exi;sub y{return sprintf %c,@_*$@*@$};


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

Date: 19 Dec 1997 22:52:07 GMT
From: jeremy@wishbone.stanford.edu (Jeremy Brinkley)
Subject: Module for Checksums?
Message-Id: <67etqn$n9r$1@nntp.Stanford.EDU>

Searched CPAN casually and didn't find what I was looking for.

What I'd like is a module to implement various checksum schemes on
arbitrary data--you'd use it like this:

use CheckSum;

$mysum = bsd_sum($data);
$mysum = md5_sum($data);

to calculate checksums like BSD's 16-bit checksum, SysV's, 32-bit CRC,
MDx, SHA, and perhaps some others.  I don't want to open a pipe to
an external command; efficiency would be cool.

If something like this doesn't exist, I'd be willing to write some
kind of libchecksum.a and the perl XS to go with it.  Does anyone
else feel the need for this?

-- 
  Jeremy Brinkley                      jeremy@wishbone.stanford.edu
  System Administrator                 finger for PGP key (2.6.2) or
  Stanford Blood Center                http://wishbone.stanford.edu/~jeremy


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

Date: 19 Dec 1997 21:50:16 GMT
From: tfletche@pcocd2.intel.com (Terry Michael Fletcher - PCD ~)
Subject: Re: Number of items in an array
Message-Id: <67eq6o$q9g$2@news.fm.intel.com>

brian d foy (comdog@computerdog.com) so eloquently and verbosely pontificated:
> In article <34995976.300FB2E4@mystech.com>, "Mark S. Reibert" <reibert@mystech.com> wrote:
> 
> >brian d foy wrote:
> >
> >>  * use @array in a scalar context (ick! i think this leads to lots
> >> of coding errors, so no example, although it works).
> >
> >Uh Oh! I feel compelled to disagree! Using arrays in scalar context can lead to nicely succinct
> >and readable code, provided one knows the difference between scalar and list context. Lines like

> i'm content to agree to disagree :), but i've run into too many problems
> with others not understanding what was going on when i've done that
> sort of thing.  i see it as a pedantic point which lass experienced 
> coders might not know about.

i see both sides here, but i would have to say that it can be just as
misleading to use scalar() to get a scalar context, when it would have
been scalar context anyways.  this can lead 'lass' experienced coders in
the wrong direction, too, thinking that it would have returned some sort
of list.

just thought i would help move this thread off topic :)

-- 
#!/usr/local/bin/perl -w- tfletche@pcocd2.intel.com
sleep 1;$"=(time-$^T)<<1;$SIG{ALRM}=sub{print};${q$_$}=join"",
map{chr(hex)}split/(..)/,"4a75737420";alarm$";<>;s y(\0\w){4}.
?yreverse q brehtonabyex;alarm$";<>;for(;length>4;chop){}tr&to
an&empti&;alarm$";<>;s@$_@reverse',ret'.q csaw c@e;alarm$";<>;



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

Date: Fri, 19 Dec 1997 23:45:08 +0100
From: Daniel Perez <danielperez@dragonet.es>
Subject: Opening remote files
Message-Id: <349AF8F3.EAA16172@dragonet.es>

Este es un mensaje multipartes en formato MIME.
--------------7EFF2C3BB74E891C399D00AE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello:

I have a problem
I want to open files in other servers (not in mine) with a Perl CGI
program from my server, and I don't know how to do it.
Can anybody help me?

Thank you very much!!!




--------------7EFF2C3BB74E891C399D00AE
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Message-ID: <34943EE4.F525BA6F@dragonet.es>
Date: Sun, 14 Dec 1997 21:17:41 +0100
From: Daniel Perez <d888@dragonet.es>
X-Mailer: Mozilla 4.03 [es] (Win95; I)
MIME-Version: 1.0
Newsgroups: comp.lang.perl.misc,comp.infosystems.www.authoring.cgi
Subject: Opening remote files
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello:

I have a problem
I want to open files in other servers (not in mine) with a Perl CGI
program, and I don't know how to do it.
Can anybody help me?

Thank you very much!!!



--------------7EFF2C3BB74E891C399D00AE--



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

Date: Fri, 19 Dec 1997 15:11:19 -0600
From: kchadha@hotmail.com
Subject: Perl 5 syntax 
Message-Id: <882565677.1094582279@dejanews.com>

Hi,

I'm using packages as part of my perl program: say I have
the following case:

use A;
use B;
use C;

(Assume A, B and C each have a function PRINT which
takes a parameter x).
(Also, assume I get read a variable $function which
can either contain the value A, B or C). I want
to do the following:

$function::PRINT($x)


I get a syntax error with the above. If I were
to do A::PRINT($x) or B::PRINT($x), I get no error.

Can I make some simple fix to the above statement ?

Please E_MAIL your answers to kchadha@hotmail.com


Thanks!

K. Chadha

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


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

Date: Fri, 19 Dec 1997 13:10:15 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jeroen Kustermans <NightLightWEGSPAM@webcity.nl>
Subject: Re: Perl editor needed
Message-Id: <Pine.GSO.3.96.971219130422.23972C-100000@user2.teleport.com>

On Thu, 18 Dec 1997, Jeroen Kustermans wrote:

> system("ls -a ./* > /tmp/dirlist.tmp");

There are better ways to do this. I recommend using readdir and family.

> open(TMP,"/tmp/dirlist.tmp");

Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.

>    system("to_dos $dirlist[$index] ./tmp.pl");

It would be nicer, if you're converting many files, to do this directly
from Perl. It's not hard, and it'll let you provide better diagnostics and
reliability. 

Of course, you could simply use a command like this...

    perl -pi -e 's/\015?\012/\015\012/' files*

 ...if you simply want to turn a number of Unix text files into DOS-format
text files. The reverse command is left as an exercise. :-)

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Fri, 19 Dec 1997 13:02:45 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dominique et Marc de GOUTTES <mdgoutte@asi.fr>
Subject: Re: Problem with socket upon HTTP
Message-Id: <Pine.GSO.3.96.971219124212.23972B-100000@user2.teleport.com>

On Fri, 19 Dec 1997, Dominique et Marc de GOUTTES wrote:

> OK, PERL told me about some problems, but none of them seems to explain
> why it doesn't work with www.yslaire.be. 

Are you using the proper HTTP protocol? The server seems to be requiring
that you play strictly by the rules. 

    http://www.ics.uci.edu/pub/ietf/http/rfc1945.html

When I fix your script to use the proper protocol, it works for me. :-) 
This is another reason to use a module that somebody else has already
debugged. 

The answer is in section 2.2 of the standards doc, if you'd still prefer
to code it up yourself. Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!





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

Date: Fri, 19 Dec 1997 21:03:34 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Randomize the order of an array
Message-Id: <ELGFty.1vJ@world.std.com>

editor@gardenweb.com (Bob Stewart) writes:

>What I have is a directory of company names. I want to set it up so
>they are not always listed A-Z, or someother set order, but in a
>fairly random way so that someone accessing the script on two
>different days is likely to see things in a different order.

The old camel book had something that I think went like this:

srand;
push @random, splice @orig, rand scalar @orig, 1 while scalar @orig;

The srand() seeds the random number generator, it should be called
once perl script. The next line creates a random number between 0 and
the last element of the original array and then uses splice to extract
that element. It then pushes that element to the randomized
array. This statement is looped as long as there are still elements in
the original array.

I guess a more verbose form would be something like this:

while(@orig) {
  my $location = rand scalar @orig;
  my $element = splice @orig, $location, 1;
  push @random, $element;
}
-- 
Andrew Langmead


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

Date: Fri, 19 Dec 1997 16:17:40 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Randomize the order of an array
Message-Id: <comdog-ya02408000R1912971617400001@news.panix.com>
Keywords: from just another new york perl hacker

In article <349ada25.480603@news.digex.net>, editor@gardenweb.com wrote:

>I want to take amn array of listings and have them display in a
>different order each time someone accesses a script.  The randomness
>does not need to be truely random.

there were some very nice routines given last time this question was
asked.  you might want to check DejaNews to see those responses.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 19 Dec 1997 16:05:50 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Scanning the access_log file
Message-Id: <comdog-ya02408000R1912971605500001@news.panix.com>
Keywords: from just another new york perl hacker

In article <01bd0cbc$237fb980$9a664ccf@586win95>, "Don" <dgoyette@NoMoreSPAMpcisys.net> wrote:

>Like many newbies here, I'm new to CGI/PERL _and_ Unix (but have lots of
>programming experience on other platforms in other languages).  I would
>like to scan the access_log file and perform a "file access count" for all
>files accessed from all web pages on our site, in the fastest (server time
>wise) way possible.

[snip]

>So, if one of you CGI/PERL/Unix gurus could point me in the right
>direction, as to the proper PERL/Unix commands to research for each of
>these purposes, I would be most grateful. 

you might want to look at the freely available scripts that already 
do this sort of thing (i'm not sure if MkStats is still available).  this
should give you an idea about how to attack the problem and ways on
which you can improve the code.

good luck :)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 19 Dec 1997 21:29:51 GMT
From: "Don" <dgoyette@NoMoreSPAMpcisys.net>
Subject: Re: Scanning the access_log file
Message-Id: <01bd0cc5$1d080f40$9a664ccf@586win95>

Hi Brian,

Thanks for your suggestion.  However, www.mkstats.com is "not found", and
this is where other site link to.  I have taken a brief look at other stats
programs, but they usually do 100 times more than I want to do, and are
very complex programs.  I was hoping to create something a bit simpler
<smile>.  Any other suggestions?

-Don

Reply to: (dgoyette"at-sign"pcisys.net) and NOT the auto-reply address
---------------------------------------------------------------------

brian d foy <comdog@computerdog.com> wrote in article
<comdog-ya02408000R1912971605500001@news.panix.com>...
> In article <01bd0cbc$237fb980$9a664ccf@586win95>, "Don"
<dgoyette@NoMoreSPAMpcisys.net> wrote:
> 
> >Like many newbies here, I'm new to CGI/PERL _and_ Unix (but have lots of
> >programming experience on other platforms in other languages).  I would
> >like to scan the access_log file and perform a "file access count" for
all
> >files accessed from all web pages on our site, in the fastest (server
time
> >wise) way possible.
> 
> [snip]
> 
> >So, if one of you CGI/PERL/Unix gurus could point me in the right
> >direction, as to the proper PERL/Unix commands to research for each of
> >these purposes, I would be most grateful. 
> 
> you might want to look at the freely available scripts that already 
> do this sort of thing (i'm not sure if MkStats is still available).  this
> should give you an idea about how to attack the problem and ways on
> which you can improve the code.
> 
> good luck :)
> 
> -- 
> brian d foy                                  <comdog@computerdog.com>
> Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
> 


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

Date: 19 Dec 1997 23:04:44 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <67euic$hm4$1@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 12 Dec 1997 23:00:04 GMT and ending at
19 Dec 1997 20:18:40 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 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:  179
Articles: 339 (137 with cutlined signatures)
Threads:  189
Volume generated: 608.1 kb
    - headers:    252.7 kb (4,836 lines)
    - bodies:     311.8 kb (9,790 lines)
    - original:   215.7 kb (7,336 lines)
    - signatures: 43.3 kb (1,021 lines)

Original Content Rating: 0.692

Averages
========

Posts per poster: 1.9
    median: 1 post
    mode:   1 post - 129 posters
    s:      3.1 posts
Posts per thread: 1.8
    median: 1 post
    mode:   1 post - 120 threads
    s:      1.7 posts
Message size: 1836.9 bytes
    - header:     763.4 bytes (14.3 lines)
    - body:       941.8 bytes (28.9 lines)
    - original:   651.7 bytes (21.6 lines)
    - signature:  130.7 bytes (3.0 lines)

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

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

   33    52.3 ( 27.9/ 17.4/  9.9)  Tom Phoenix <rootbeer@teleport.com>
   19    31.5 ( 16.7/ 10.8/  5.7)  comdog@computerdog.com (brian d foy)
    9    20.5 (  7.1/  8.3/  7.0)  Stephan Vladimir Bugaj <bugaj@bell-labs.com>
    7    13.5 (  4.2/  9.2/  6.1)  tadmc@metronet.com (Tad McClellan)
    7    14.4 (  5.8/  8.6/  5.9)  Anthony David <adavid@netinfo.com.au>
    7    15.1 (  3.8/ 11.2/  9.9)  aml@world.std.com (Andrew M. Langmead)
    6    12.6 (  4.4/  6.0/  4.5)  Randal Schwartz <merlyn@stonehenge.com>
    6     7.7 (  4.4/  3.3/  2.1)  bart.mediamind@tornado.be (Bart Lateur)
    6     8.5 (  3.7/  4.8/  3.0)  adelton@fi.muni.cz (Honza Pazdziora)
    5     7.0 (  4.2/  2.0/  1.3)  tchrist@mox.perl.com (Tom Christiansen)

These posters accounted for 31.0% of all articles.

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

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

  52.3 ( 27.9/ 17.4/  9.9)     33  Tom Phoenix <rootbeer@teleport.com>
  31.5 ( 16.7/ 10.8/  5.7)     19  comdog@computerdog.com (brian d foy)
  20.5 (  7.1/  8.3/  7.0)      9  Stephan Vladimir Bugaj <bugaj@bell-labs.com>
  15.1 (  3.8/ 11.2/  9.9)      7  aml@world.std.com (Andrew M. Langmead)
  14.4 (  5.8/  8.6/  5.9)      7  Anthony David <adavid@netinfo.com.au>
  13.5 (  4.2/  9.2/  6.1)      7  tadmc@metronet.com (Tad McClellan)
  12.6 (  4.4/  6.0/  4.5)      6  Randal Schwartz <merlyn@stonehenge.com>
  12.1 (  1.7/  4.7/  3.3)      3  Clark Dorman <clark@s3i.com>
  10.0 (  4.4/  5.3/  2.3)      5  abigail@fnx.com
   9.6 (  3.0/  5.8/  3.9)      4  Dave Barnett <barnett@houston.Geco-Prakla.slb.com>

These posters accounted for 31.5% of the total volume.

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

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

0.879  (  9.9 / 11.2)      7  aml@world.std.com (Andrew M. Langmead)
0.847  (  7.0 /  8.3)      9  Stephan Vladimir Bugaj <bugaj@bell-labs.com>
0.755  (  4.5 /  6.0)      6  Randal Schwartz <merlyn@stonehenge.com>
0.687  (  5.9 /  8.6)      7  Anthony David <adavid@netinfo.com.au>
0.666  (  6.1 /  9.2)      7  tadmc@metronet.com (Tad McClellan)
0.641  (  2.1 /  3.3)      6  bart.mediamind@tornado.be (Bart Lateur)
0.638  (  1.3 /  2.0)      5  tchrist@mox.perl.com (Tom Christiansen)
0.626  (  3.0 /  4.8)      6  adelton@fi.muni.cz (Honza Pazdziora)
0.566  (  9.9 / 17.4)     33  Tom Phoenix <rootbeer@teleport.com>
0.550  (  2.9 /  5.2)      5  rjk@coos.dartmouth.edu

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

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

0.687  (  5.9 /  8.6)      7  Anthony David <adavid@netinfo.com.au>
0.666  (  6.1 /  9.2)      7  tadmc@metronet.com (Tad McClellan)
0.641  (  2.1 /  3.3)      6  bart.mediamind@tornado.be (Bart Lateur)
0.638  (  1.3 /  2.0)      5  tchrist@mox.perl.com (Tom Christiansen)
0.626  (  3.0 /  4.8)      6  adelton@fi.muni.cz (Honza Pazdziora)
0.566  (  9.9 / 17.4)     33  Tom Phoenix <rootbeer@teleport.com>
0.550  (  2.9 /  5.2)      5  rjk@coos.dartmouth.edu
0.532  (  5.7 / 10.8)     19  comdog@computerdog.com (brian d foy)
0.428  (  2.3 /  5.3)      5  abigail@fnx.com
0.365  (  0.9 /  2.6)      5  scribble@tekka.wwa.com (Tushar Samant)

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

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

   17  Re: Which language pays most 17457 -- C++ vs. Java?
   10  Re: Teaching programing
    8  Re: No Flock! -- Now What?
    7  Re: setting environment variable within perl script
    6  Re: What kind of machine wouldn't support FLOCK?
    6  unshift, @INC, require???
    5  Another Sort problem, this time with numbers
    5  Re: pgp encrypion via perl script
    4  Changing passwd
    4  Re: Whats wrong with this simple code?

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

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

  41.5 ( 18.5/ 21.6/ 11.9)     17  Re: Which language pays most 17457 -- C++ vs. Java?
  22.8 (  6.8/ 14.3/ 11.8)     10  Re: Teaching programing
  13.8 (  6.1/  7.0/  3.8)      7  Re: setting environment variable within perl script
  13.8 (  3.4/ 10.2/  7.8)      5  Another Sort problem, this time with numbers
  13.2 (  5.7/  6.5/  4.4)      8  Re: No Flock! -- Now What?
  10.0 (  4.5/  4.5/  3.2)      6  Re: What kind of machine wouldn't support FLOCK?
   9.9 (  4.1/  4.9/  2.5)      5  Re: pgp encrypion via perl script
   9.3 (  2.3/  6.1/  2.4)      3  Re: 6 elementary questions
   8.9 (  3.3/  5.4/  3.7)      4  Re: localtime() _is_ year-2000 compliant, right?
   8.8 (  2.5/  6.2/  4.2)      4  Re: Q: sorting hash by category

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

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

0.887  (  2.1/   2.4)      3  Re: perl program very slow
0.876  (  2.1/   2.4)      3  Problem with socket upon HTTP
0.851  (  3.5/   4.1)      4  Re: Sorting Hashes By Value
0.848  (  1.6/   1.9)      3  Re: one liners
0.830  ( 11.8/  14.3)     10  Re: Teaching programing
0.778  (  2.0/   2.6)      3  Fun with arrays
0.777  (  1.9/   2.4)      4  Changing passwd
0.766  (  7.8/  10.2)      5  Another Sort problem, this time with numbers
0.757  (  0.7/   0.9)      3  problem with this script?
0.739  (  2.5/   3.3)      3  Re: <SELECT MULTIPLE >  Script only gives one value. Can you help?

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

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

0.550  ( 11.9 / 21.6)     17  Re: Which language pays most 17457 -- C++ vs. Java?
0.548  (  3.8 /  7.0)      7  Re: setting environment variable within perl script
0.540  (  0.8 /  1.5)      3  Re: last modification date on files
0.530  (  1.5 /  2.9)      4  Re: A sort list problem ...
0.515  (  1.0 /  2.0)      4  Re: Whats wrong with this simple code?
0.510  (  2.5 /  4.9)      5  Re: pgp encrypion via perl script
0.485  (  1.9 /  3.9)      3  Re: Q: limiting the input array size
0.427  (  0.9 /  2.0)      4  Re: mkdir command
0.394  (  2.4 /  6.1)      3  Re: 6 elementary questions
0.388  (  0.8 /  2.1)      3  Re: newbie: compact an array

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

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

      19  comp.lang.java.programmer
      17  comp.lang.smalltalk
      17  comp.lang.ada
      16  comp.lang.c++
      16  comp.lang.fortran
      16  comp.lang.c
      16  comp.lang.eiffel
      15  misc.jobs.misc
      12  comp.edu
       9  nyc.food

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

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

      13  Roedy Green <roedy@BIX.com>
      10  kaz@cafe.net
      10  gschwarz@netup.cl
      10  seebs@plethora.net (Peter Seebach)
      10  Stephen Taylor <steve@afs.net.au>
      10  fred@genesis.demon.co.uk
      10  dewar@merv.cs.nyu.edu (Robert Dewar)
      10  mdkersey@hal-pc.org
      10  grunes@imsy1.nrl.navy.mil (Mitchell R Grunes)
       9  Yves CONSTANTINIDIS <yconstan@easynet.fr>


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

Date: Fri, 19 Dec 1997 16:00:53 -0500
From: comdog@computerdog.com (brian d foy)
Subject: suid (was Re: Sending a signal...)
Message-Id: <comdog-ya02408000R1912971600530001@news.panix.com>
Keywords: from just another new york perl hacker

In article <eli$9712191459@qz.little-neck.ny.us>, Eli the Bearded <#@qz.to> wrote:                                                             ^
                                                                   |
[can i hack sendmail too?]-----------------------------------------+

>In article <349a535c.0@lightning.ica.net>,  <lee.gammell@feedME> wrote:
>> You can only do this if you make your script suid (setuid) to root
>> 
>> chmod ug+xs script-name  # sets suid and sgid 
>> chown root script-name
>> chgrp mygrp script-name
>
>This is not perl specific. (I bet that when you chown/chgrp anything
>your suid and sgid bits get cleared anyway.)

not if you are the super-user at the time (although it is true for
non-priveleged users).  i assume that if you are chown()-ing to root
that you have su priveleges... ;)

# uname -a
SunOS sri 5.5 Generic sun4m sparc SUNW,SPARCstation-20
# /usr/ucb/whoami
root
# ls -l test.pl
-rw-r--r--   1 chica   staff         241 Dec 17 09:20 test.pl
# chmod 6775 test.pl; ls -l test.pl
-rwsrwsr-x   1 chica   staff         241 Dec 17 09:20 test.pl
# chown root:other test.pl; ls -l test.pl
-rwsrwsr-x   1 root     other        241 Dec 17 09:20 test.pl

>> suid scripts will run in taint mode, thus you may need to untaint some variables
>You should also check that they are reasonable.

paranoia and data fascism would be good :)

-- 
brian d foy                                  <comdog@computerdog.com>
Meta Meta FAQ <URL:http://computerdog.com/Meta_MetaFAQ.html>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: Fri, 19 Dec 1997 18:32:40 -0500
From: Guillermo Schwarz <gschwarz@its.cl>
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <349B0417.D4DB6A30@its.cl>

This is a multi-part message in MIME format.
--------------EC36FA96B4325E47CB41380A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit



Kaz Kylheku wrote:

> In article <e9k976.8h3.ln@localhost>, Tad McClellan <tadmc@metronet.com> wrote:
> >: what do strcmp, strstr etc do?
> >          ^^^^^^  ^^^^^^
> >
> >Those are not *primitives* (ie. built-in to the language).
> >
> >Those are library calls (ie. add-ons to the language).
>
> Nonsense. They are standard parts of the C language required by the ISO
> standard.

The standard C library, but not he standard C language.In the same way, other
languages have standard libraries.
Some have huge libraries, as Smalltalk does.

> >You won't find 'strcmp' in a C compiler's grammar.
>
> I use a compiler which will inline functions like strcpy() and abs().

It has nothing to do with optimization. The point is that C has no built-in support
for Strings.
Even worse, that optimization can be a bug.
What if I define a class:

class foo()
{
public:
      char * strcmp( char * a, char * b ) { ... }
     void bar()
     {
           ...
           strcmp( a, b );
           ...
      }
};

I wouldn't expect the compiler to "optimize" my code.

Most C compilers are bugged, so when programs behave strangely, they switch
optimizations off.
Optimization is not a new science, but a very fuzzy one.

--------------EC36FA96B4325E47CB41380A
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Guillermo  Schwarz
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Guillermo  Schwarz
n:              Schwarz;Guillermo 
org:            ITS
email;internet: gschwarz@its.cl
title:          Software Engineer
note:           Remove stop.spam to reply by mail.
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------EC36FA96B4325E47CB41380A--



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

Date: 19 Dec 1997 23:28:07 GMT
From: jeer.btrj3clfclcclcclecljpclsclpmclace@born.ph.utexas.edu (Quowong P Liu)
Subject: Re: Which language pays most 17457 -- C++ vs. Java?
Message-Id: <67evu7$9db$1@geraldo.cc.utexas.edu>

In article <199712121931.LAA25389@sirius.infonex.com>,
appearing in comp.lang.fortran, Mix <mixmaster@remail.obscura.com> writes,

>The question is, which language will pay top 17457 in the long run?

Where the heck does 17457 come from?

Bill Gates is rich.  What language does Bill Gates like?


I don't see why anyone who'll be programming professionally
shouldn't be able to pick up the essentials of Fortran(90/95/hpf),
C, C++, Eiffel, Java, Smalltalk, perl, or Ada(95) in short order,
especially with a good grounding in object oriented programming.
(I notice no languages emphasizing functional programming are in
the list.)

-- 
qpliu.sbtrj3mjmclfclcclcnfclecljpclsclpmclace@born.ph.utexas.edu


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

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

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