[12387] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5988 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 14 12:07:32 1999

Date: Mon, 14 Jun 99 09:01:27 -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, 14 Jun 1999     Volume: 8 Number: 5988

Today's topics:
    Re: run .exe on Win32 <swiftkid@bigfoot.com>
    Re: size of a subdirectory without readdir? <swiftkid@bigfoot.com>
        Socket Woes <mnwhaley@mindspring.com>
    Re: Sort log <gellyfish@gellyfish.com>
    Re: Sort log <paul.bunkham@synetica.com>
        Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
    Re: trouble with this script , plz take a look <tchrist@mox.perl.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 10 Jun 1999 13:35:40 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: run .exe on Win32
Message-Id: <7jp0lm$9ip1@proxy.cyber.net.pk>

c program = c:\etc\myfile.exe
perl program = c:\perl\myperl.pl

you would use:

$output = `c:\\etc\\myfile.exe`;

Output of myfile.exe is caught in $output.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877
<jbell@263.net> wrote in message news:7jn87u$5nf$1@nnrp1.deja.com...
>Hi, all,
>
>I'm trying to run a .exe program(a C program) from perl
>with the "system" function.
>This programs reads input from a data file in the same
>directory.  Now I have two questions,
>1. The perl program can be run only when it's in the same
>   direcotry with the .exe program and the data file.
>   How can I run the perl program from a different dir.
>2. This program prints output to the screen.  In the perl
>   program how can I store the output in a string or array?
>3. Is there a more effective way to call this c program
>   other than using "system"?
>
>Thanks a lot!
>
>---
>Jim
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.




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

Date: Wed, 9 Jun 1999 13:14:04 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: size of a subdirectory without readdir?
Message-Id: <7jmb11$2qc4@proxy.cyber.net.pk>

$dir = "/etc/path";
map { $s += -s } <$dir/*>;

print $s;

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Faisal Nasim (the Whiz Kid)
Web: http://wss.hypermart.net/
AOL: Whiz Swift
ICQ: 4265451
FAX: (815) 846-2877
William Herrera <posting.account@lynxview.com> wrote in message
news:375e152f.3156645@news.rmi.net...
>I have to read a directory from time to time that may contain 300 to
>2000 entries. opendir/readdir just to count the entries (archiving
>when they are above a certain number like 500) can be slow.
>
>Is there a better/faster way in Perl to count how many files are in a
>subdirectory?
>
>
>
>---
>The above from: address is spamblocked. Use wherrera (at) lynxview (dot)
com for the reply address.




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

Date: Mon, 14 Jun 1999 11:14:59 -0400
From: "Morgan Whaley" <mnwhaley@mindspring.com>
Subject: Socket Woes
Message-Id: <7k3658$83f$1@news-feed-1.peachnet.edu>

I am writing a server pgm & need to determine the absence vs. presence of a
client connection to a server socket.

This loop will occur after the server socket has been established & an
accept has been received.

I've tried

while (<CLIENT>){
 ....
}

but never encounter the expected results.

Any ideas?

TIA,
Morgan Whaley
mwhaley@mail.mcg.edu






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

Date: 14 Jun 1999 15:56:42 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sort log
Message-Id: <3765182a@newsread3.dircon.co.uk>

Twarren10 <twarren10@aol.com> wrote:
>>
>>Try out my first suggestion - believe me that is what you want to do.
>>
> 
> hi again, 
> I did try it, and I just tried it again. I get the same results. The date comes
> up ok this way, but then the sort doesn't work and they're no longer in
> descending order. I've replaced one problem with another. I'm trying to figure
> out why, but as yet have not traced the problem. Any suggestions?
> 

Because you now have references to anonymous arrays in you hash now rather
than just your $score you have to ensure that you address this in your
sort sub :

  { $scores{$b}->[0] <=> $scores{$a}->[0] }

If it is coming out in the wrong order try swapping the $a and the $b.

/J\
-- 
"I'm about to say a naughty word so if you're easily offended you can
fuck off now" - Daisy Donovan, The 11 O'Clock Show


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

Date: Mon, 14 Jun 1999 16:22:06 +0100
From: Paul Bunkham <paul.bunkham@synetica.com>
Subject: Re: Sort log
Message-Id: <37651E1E.4B6E1D15@synetica.com>

Twarren10 wrote:
> 
> >I think what Jonathon wrote actually answered your question, did you try
> >the code he gave you?
> 
> Yes, but it doesn't sort when I do that. I just tried it again with the same
> results, The dates are in alright, but now the sorting is not working
> correctly.

Very strange, sounds like somethings gone really wrong.  I tested that I
wasn't telling you to do the wrong thing, by writing a little test
script out of the code snippets posted, which was:

#!perl

open FILE1, "<sort.txt";
while(<FILE1>){
    chomp;
    my ($searchword, $score, $tdate) = split(/\|/);
    $scores{$searchword} = [$score,$tdate];
}
close FILE1;

foreach $word (sort { $scores{$b}->[0] <=> $scores{$a}->[0] } keys
%scores){
   print $word,"\t",$scores{$word}->[1],"\t",$scores{$word}->[0],"\n";
}

I know this isn't strictly (no pun meant) correct perl, but it should
show you that it works.  The sort.txt in this case was just contained
the three lines that you posted as example format, and was held in the
same directory as the script.  The output looks something like this:

clothes 	Tue Jun 15 03:05:20 1999        17
furniture       Mon Jun 14 03:25:44 1999        10
automobile      Sat Jun 20 01:14:31 1999        1

I assume this is what you wanted to do?  If this shows something I don't
understand then please enlighten me.

Hope this helps some more,

Paul.

-- 
*****************************************
Paul Bunkham
Developer
Synetica Knowledge Technologies
*****************************************


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

Date: 14 Jun 1999 15:48:53 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <7k3895$f1r$1@info2.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 07 Jun 1999 15:06:39 GMT and ending at
14 Jun 1999 19:45:18 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) 1999 Greg Bacon.
      Verbatim copying and redistribution is permitted without royalty;
      alteration is not permitted.  Redistribution and/or use for any
      commercial purpose is prohibited.

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

perlfaq-suggestions\@(?:.*\.)?perl\.com

Totals
======

Posters:  551
Articles: 1757 (758 with cutlined signatures)
Threads:  517
Volume generated: 3221.9 kb
    - headers:    1332.0 kb (26,686 lines)
    - bodies:     1759.9 kb (57,165 lines)
    - original:   1224.8 kb (42,721 lines)
    - signatures: 128.3 kb (2,847 lines)

Original Content Rating: 0.696

Averages
========

Posts per poster: 3.2
    median: 1 post
    mode:   1 post - 344 posters
    s:      38.7 posts
Posts per thread: 3.4
    median: 3 posts
    mode:   1 post - 139 threads
    s:      3.7 posts
Message size: 1877.7 bytes
    - header:     776.3 bytes (15.2 lines)
    - body:       1025.7 bytes (32.5 lines)
    - original:   713.9 bytes (24.3 lines)
    - signature:  74.8 bytes (1.6 lines)

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

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

  111   185.4 (103.7/ 67.9/ 45.0)  Tom Phoenix <rootbeer@redcat.com>
   92   165.7 ( 70.5/ 81.9/ 40.9)  Jonathan Stowe <gellyfish@gellyfish.com>
   82   137.4 ( 50.9/ 77.5/ 45.4)  lr@hpl.hp.com (Larry Rosler)
   73   151.2 ( 81.0/ 40.7/ 35.3)  abigail@delanet.com
   41    61.4 ( 23.6/ 37.8/ 23.5)  tadmc@metronet.com (Tad McClellan)
   36    76.9 ( 28.5/ 44.1/ 26.9)  David Cassell <cassell@mail.cor.epa.gov>
   32    43.1 ( 19.5/ 23.2/  9.1)  hasant@trabas.co.id (Hasanuddin Tamir)
   27    58.4 ( 22.8/ 27.3/ 13.5)  Uri Guttman <uri@sysarch.com>
   25   238.7 ( 20.3/215.5/210.1)  tchrist@mox.perl.com (Tom Christiansen)
   24    38.0 ( 15.4/ 22.5/ 11.1)  marcel.grunauer@lovely.net (Marcel Grunauer)

These posters accounted for 30.9% of all articles.

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

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

 238.7 ( 20.3/215.5/210.1)     25  tchrist@mox.perl.com (Tom Christiansen)
 185.4 (103.7/ 67.9/ 45.0)    111  Tom Phoenix <rootbeer@redcat.com>
 165.7 ( 70.5/ 81.9/ 40.9)     92  Jonathan Stowe <gellyfish@gellyfish.com>
 151.2 ( 81.0/ 40.7/ 35.3)     73  abigail@delanet.com
 137.4 ( 50.9/ 77.5/ 45.4)     82  lr@hpl.hp.com (Larry Rosler)
  76.9 ( 28.5/ 44.1/ 26.9)     36  David Cassell <cassell@mail.cor.epa.gov>
  61.4 ( 23.6/ 37.8/ 23.5)     41  tadmc@metronet.com (Tad McClellan)
  58.4 ( 22.8/ 27.3/ 13.5)     27  Uri Guttman <uri@sysarch.com>
  53.9 ( 17.4/ 36.5/ 21.9)     17  John Porter <jdporter@min.net>
  49.2 ( 11.3/ 37.8/ 15.8)      9  armchair@my-deja.com

These posters accounted for 36.6% of the total volume.

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

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

1.000  (  1.4 /  1.4)      7  "Lim Chong Sun" <chongsun@krdl.org.sg>
1.000  (  1.9 /  1.9)      7  Raj <technology@workmail.com>
1.000  (  2.0 /  2.0)      5  R . Joseph <streaking_pyro@my-deja.com>
0.990  (  6.4 /  6.5)      9  andrew-johnson@home.com
0.985  (  5.8 /  5.9)      6  pudge@pobox.com (Chris Nandor)
0.975  (210.1 /215.5)     25  tchrist@mox.perl.com (Tom Christiansen)
0.950  (  1.6 /  1.7)      5  twarren10@aol.com (Twarren10)
0.911  (  3.4 /  3.8)      5  "Clinton Gormley" <clint@drtech.co.uk>
0.901  (  4.1 /  4.5)     10  fl_aggie@thepentagon.com
0.866  ( 35.3 / 40.7)     73  abigail@delanet.com

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

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

0.458  (  1.9 /  4.1)      7  brian@pm.org (brian d foy)
0.418  ( 15.8 / 37.8)      9  armchair@my-deja.com
0.415  (  4.3 / 10.5)     15  ada@fc.hp.com (Andrew Allen)
0.390  (  9.1 / 23.2)     32  hasant@trabas.co.id (Hasanuddin Tamir)
0.378  (  1.9 /  5.0)      8  rlb@intrinsix.ca (Lee)
0.378  (  1.3 /  3.5)      7  alastair@calliope.demon.co.uk
0.355  (  2.2 /  6.2)      6  efflandt@xnet.com
0.343  (  1.1 /  3.2)      6  Brent Michalski <perlguy@technologist.com>
0.338  (  4.7 / 14.0)     10  Craig Ciquera <craig@mathworks.com>
0.301  (  2.4 /  8.0)      9  dalehend@flash.net

72 posters (13%) had at least five posts.

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

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

   20  Perl "constructors"
   17  Get Date in Perl
   16  disalowing words
   16  MIcrosofts Attack on Perl
   15  Intersection of SEVERAL ( eg. 5 -> ) lists
   15  can i variably name an array?
   14  Calculating weekday given year, month and day
   14  Regexpr for loop to handle e-address list
   14  Perl on win32
   14  if (my $a=1) { } print $a; Why do i get undef an not "1" ??

These threads accounted for 8.8% of all articles.

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

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

  93.5 ( 25.2/ 67.9/ 32.8)     20  Perl "constructors"
  73.6 (  4.8/ 67.9/ 67.6)      6  Rounding excessive trailing decimals
  49.9 (  7.6/ 41.2/ 35.9)     10  quiz for perl professionals
  45.3 (  4.6/ 39.8/ 37.2)      6  Formmail with Credit Card Validation problems
  43.6 (  1.3/ 42.2/ 42.0)      2  Q: How unlock flock of a other process
  39.6 (  4.2/ 34.6/ 32.7)      6  long string
  35.1 (  9.2/ 24.7/ 23.2)     12  Perldoc and Perlfaq
  34.0 ( 15.0/ 17.1/  9.7)     17  Get Date in Perl
  33.1 ( 12.9/ 19.1/ 14.6)     16  MIcrosofts Attack on Perl
  28.6 ( 13.2/ 14.8/  5.4)     14  Regexpr for loop to handle e-address list

These threads accounted for 14.8% of the total volume.

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

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

0.996  ( 67.6/  67.9)      6  Rounding excessive trailing decimals
0.947  ( 32.7/  34.6)      6  long string
0.938  ( 23.2/  24.7)     12  Perldoc and Perlfaq
0.936  ( 37.2/  39.8)      6  Formmail with Credit Card Validation problems
0.871  ( 35.9/  41.2)     10  quiz for perl professionals
0.860  (  7.1/   8.3)      5  Possible compiler error when passing associative arrays
0.857  (  3.6/   4.2)      6  how do i refresh frames from perl?
0.849  (  3.9/   4.6)      6  macperl - directory names with embedded spaces
0.829  (  1.6/   2.0)      5  Disokaying files in a Browser
0.807  (  4.1/   5.1)      5  Log file

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

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

0.471  (  4.6 /  9.8)     13  fork for DNS lookup - help
0.465  (  5.5 / 11.8)     14  Perl on win32
0.463  (  1.6 /  3.4)      5  Problems sorting. I'm stupid and I'll die
0.457  (  4.3 /  9.4)      9  PerlScript ... what features are missing?
0.440  (  2.3 /  5.2)      8  OLE reference
0.427  (  7.5 / 17.5)      7  dimensions of a jpg file
0.406  (  1.9 /  4.6)      6  Calling an applet from perl
0.400  (  2.5 /  6.1)      5  CGI script from win32 -> IE4.0
0.387  (  1.7 /  4.4)      6  holding shell output in perl
0.364  (  5.4 / 14.8)     14  Regexpr for loop to handle e-address list

116 threads (22%) had at least five posts.

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

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

      24  comp.lang.perl.modules
      10  comp.lang.perl
       7  alt.perl
       7  comp.unix.questions
       6  comp.emacs
       6  comp.lang.java.programmer
       5  comp.lang.awk
       5  comp.os.linux.misc
       5  comp.unix.shell
       5  comp.unix.solaris

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

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

       5  "Clinton Gormley" <clint@drtech.co.uk>
       5  David <davidf@gaylordusa.com>
       5  efflandt@xnet.com
       4  ada@fc.hp.com (Andrew Allen)
       4  ken@halcyon.com
       3  Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
       3  NightLight@webcity.nl.NOSPAM!!!!!! (Jeroen Kustermans)
       3  jde222RemovethiS@iname.com
       2  ilya@math.ohio-state.edu (Ilya Zakharevich)
       2  Don Cooper <dcooper@cts.com>


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

Date: 14 Jun 1999 09:14:37 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: trouble with this script , plz take a look
Message-Id: <37651c5d@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    "Bastiaan S van den Berg" <buzz@ddsw.nl> writes:
:i can't get the errors by redirecting STDERR to STDOUT
:i can't get the logs , cause my isp won't let me

Then you are lost.  Abandon all hope, and consider a career serving
espresso.  What you are describing is simply not a tolerable situation.
You might as well be told that you may attempt to compile programs,
but aren't allowed to see any warnings or errors.  You just get a 
"yes" or "no".  That's not good enough.  Period.

:i've tried locating it in the faqs but haven't found it..
:%invoer=&cgiparse();

If you used the standard Perl distribution, you would be a lot
less unhappy.  Not only is the CGI.pm module completely standard
and supported, the distribution also ships with CGI::Carp, which 
would help you here: its carpout() function is doubtless just
what you're looking for.

--tom

-- 
    I already have too much problem with people thinking the efficiency of
    a perl construct is related to its length.  On the other hand, I'm
    perfectly capable of changing my mind next week...  :-) --lwall


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

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


Administrivia:

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

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

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V8 Issue 5988
**************************************

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