[23446] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5661 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 15 03:05:52 2003

Date: Wed, 15 Oct 2003 00:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 15 Oct 2003     Volume: 10 Number: 5661

Today's topics:
        ANNOUNCE: Tk::CursorControl-0.3 (Jack D)
    Re: Check disk usage with Windows Standard Perl Modules (ko)
        cleanup speed (named vs anonymous (and my?)) <ewilhelm@somethinglike.sbcglobalDOTnet>
        Converting indented data to a tree <tore@aursand.no>
    Re: How to update entries in a file <no@spam.here>
    Re: How to update entries in a file <no@spam.here>
    Re: How to update entries in a file <no@spam.here>
    Re: How to update entries in a file (Randal L. Schwartz)
    Re: Perl scripts for Unix on my windows machine (Ren Patterson)
    Re: Perl scripts for Unix on my windows machine (Tad McClellan)
    Re: Please help re Perl script modification <djo@pacifier.com>
        send e-mail and attachment <takashiyyy@yahoo.com>
    Re: send e-mail and attachment <mbudash@sonic.net>
    Re: send e-mail and attachment <tore@aursand.no>
        TCP close_wait problem (Grant)
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 15 Oct 2003 01:45:53 GMT
From: goodcall1@hotmail.com (Jack D)
Subject: ANNOUNCE: Tk::CursorControl-0.3
Message-Id: <HMsBGE.5vx@zorch.sf-bay.org>

A new version of Tk::CursorControl has been uploaded to CPAN. Changes
for this new release:

0.03  Tue Oct 14 01:02:00 2003
  - Suppress error messages on subsequent class initiation calls
  - *NEW* moveto function allows *smooth* warping of pointer
  - Added to POD
  - Changed widget demo to show new moveto method

Tk::CursorControl offers a Tk programmer the functionality of easily
warping, moving, confining or hiding a mouse cursor.

Jack Dunnigan




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

Date: 14 Oct 2003 18:20:12 -0700
From: kuujinbo@hotmail.com (ko)
Subject: Re: Check disk usage with Windows Standard Perl Modules [beginner]
Message-Id: <92d64088.0310141720.69d9543c@posting.google.com>

rui.vilao@rocketmail.com (Rui Vilao) wrote in message news:<385a715f.0310141057.373ea613@posting.google.com>...
> Greetings,
> 
> I am starting with Perl for Windows System Administration?
> 
> I want to write a script that keeps on running and checks periodically
> if some drives utilization exceeds a given threshold? and runs a purge
> job if necessary (BackupExec archive job).
> 
> Is there a function within a standard Perl module I can use for this
> (e.g. Win32::File)?
> 
> Any help/suggestion is highly appreciated. 
> 
> Thanks in advance for your help, 
> 
> Kind Regards, 
> 
> Rui Vilao.

W2K and above (don't know about anything before W2K) also allow
another alternative, du, which I neglected in previous post:

use strict;
use warnings;

my $total;
my @sizes = `du DRIVE_OR_DIRECTORY`; # capture du output w/backticks
foreach (@sizes) {
  (my $size) = $_ =~ /^(\d+)/;
  $total += $size;
}
print "$total\n";

Then compare $total to whatever the quota is and run the
backup/archive.

HTH - keith


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

Date: Wed, 15 Oct 2003 05:48:57 GMT
From: Eric Wilhelm <ewilhelm@somethinglike.sbcglobalDOTnet>
Subject: cleanup speed (named vs anonymous (and my?))
Message-Id: <pan.2003.10.15.00.48.53.475835.13509@somethinglike.sbcglobalDOTnet>

I've been working on a 2D drafting / geometry module (CAD::Drawing) and 
noticed some HUGE slowdown when working with extremely large hashes.  

This is an object-oriented module, so the typical blessed hash reference
is returned by the constructor function:

sub new {
  my $caller = shift;
  my $class = ref($caller) || $caller;
  my $self = {@_};
  bless($self, $class);
  return($self);
}

The two keys under which most of the data is stored are $self->{g} (all
geometry, nested by layer name and then entity) and $self->{colortrack}
(keeping lists of addresses nested by layer,entity, then color.)

While loading the data into the structure took very little time with the
above function, I knocked about 11 minutes off of the cleanup using the
one below (from 11m27.723s down to 0m31.711s loading 689850 circles onto
4590 layers.

sub new {
  my $caller = shift;
  my $class = ref($caller) || $caller;
  my $self = {@_};
  # this is clunky, but saves -_#*HUGE*#_- on big drawings!
  $CAD::Drawing::geometry_data{$self} = {};
  $self->{g} = $CAD::Drawing::geometry_data{$self};
  $CAD::Drawing::color_tracking{$self} = {};
  $self->{colortrack} = $CAD::Drawing::color_tracking{$self};
  bless($self, $class);
  return($self);
}

Is it documented somewhere that named references cleanup faster than
anonymous ones?  I've been crawling through the manual, google, the
archives of this group, etc.  I've managed to find something about
lexical variables and attempts at memory reuse, but that doesn't seem
like the issue.

There is somewhat of a hint in the camel book about springing references
to life by dereferencing them as lvalues.  Is this the reason for the
slowdown?  I've noticed a similar (but maybe unrelated?) issue when using
my for a reference to a nested array:

$ time perl -e '$l = shift;
for($i=0;$i<$l;$i++) {
  for($j=0;$j<$l;$j++) {
    $d->[$i][$j] = [$i,$j];
    }
  }' 2000

real    0m8.190s

But when I claim $d as 'my':

$ time perl -e 'my $d; $l = shift;
for($i=0;$i<$l;$i++) {
  for($j=0;$j<$l;$j++) {
    $d->[$i][$j] = [$i,$j];
    }
  }'  2000

real    0m11.671s

I'm using v5.6.1 on Linux 2.4.21 (memory is not a problem, all tests have
been well within available ram (though the my'd variables do seem to use
more memory.))

Putting a print statement at the end of the loops shows that a good deal
of time is spent after the loops are done iff you said 'my $d;'

Anyone able to shed some light on this?

Thanks
Eric


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

Date: Wed, 15 Oct 2003 09:00:40 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Converting indented data to a tree
Message-Id: <pan.2003.10.15.07.00.16.981442@aursand.no>

Hi!

I need to convert a large text file with indented data into a tree (ie.
into a child-parent relationship).

The text file looks like this:

Page 1
    Page 1.1
        Page 1.1.1
        Page 1.1.2
    Page 1.2
    Page 1.3
Page 2
    Page 2.1

I know that for each "level", there are a known number of spaces (in this
case 4), or 0 spaces if we're on a root level.

For each line I want to assign an incremental counter, so that I should
end up with an array of arrays representing the tree.  For the example
above the array would look like this:

  @array = (
      [1,0], # Page 1
      [2,1], #     Page 1.1
      [3,2], #         Page 1.1.1
      [4,2], #         Page 1.1.2
      [5,1], #     Page 1.2
      [6,1], #     Page 1.3
      [7,0], # Page 2
      [8,7], #     Page 2.1
  );

I guess you'll get the idea.  I'm totally stuck on this one, and I would
like some help from you guys (and girls).

Thanks in advance!


-- 
Tore Aursand <tore@aursand.no>


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

Date: Wed, 15 Oct 2003 04:41:08 GMT
From: "John" <no@spam.here>
Subject: Re: How to update entries in a file
Message-Id: <Ed4jb.151360$bo1.49466@news-server.bigpond.net.au>


"Roy Johnson" <rjohnson@shell.com> wrote in message
news:3ee08638.0310140848.6ba64e30@posting.google.com...
> "John" <no@spam.here> wrote in message
news:<YdPib.150444$bo1.70104@news-server.bigpond.net.au>...
> > Hi,
> >
> > I have a file entry in the following format:
> > <Employee number="111222">
> >     <Department>Sales</Department>
> >                 <Surname>Jones</Surname>
> >                 <Name>Tom</Name>
> > </Employee number>
> >
> >
> > Then, I'd like to update another file with the above entry. What I need
> > though is to first check whether this entry already exists in the file
to be
> > updated.
>
> Does that mean an entry with the same employee number (regardless of
> other information) exists? If so, your key will be (only) the employee
> number. The other fields can be stored in an anonymous hash, or array,
> if the tags are consistent.
>
> So start with a hash:
>     my %entry;
> Parsing is up to you.
>
> When you want to know if an entry exists, it's just
>     if ($entry{$emp_no}) {...
> Although if your only reason for checking is to see whether you need
> to make a new entry, that's automatic. Just write all the new entries,
> and they'll overwrite any older versions of themselves.
>
> When you're ready to assign your tags, it might look like:
>     $entry{$emp_no} = [$dept, $surname, $name];
> or
>     $entry{$emp_no} = { department => $dept,
>                         surname    => $surname,
>                         name       => $name
>                       };
> or even (if the tags are variable)
>     $entry{$emp_no} = { %record_hash };
> where you've parsed a single record's tag names as keys and the
> contents as values into %record_hash.

Just to confirm:
FILE_A [this is the file containing the update info] will only have one
record at a time.
Each record is composed of 5 lines. Each record has identical tags as listed
previously.
Before one can update FILE_B [this is the file containing all records], one
needs to check
whether a record with a given EmployeeNumber already exists.
If no, then we just append the record to the end of FILE_B.
If yes, then we delete the old record in FILE_B and then we append the
record to the end of FILE_B.

Thanks very much Roy. Will try. :)





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

Date: Wed, 15 Oct 2003 06:24:39 GMT
From: "John" <no@spam.here>
Subject: Re: How to update entries in a file
Message-Id: <HK5jb.151453$bo1.61790@news-server.bigpond.net.au>


"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnbootdd.57a.tadmc@magna.augustmail.com...
> John <no@spam.here> wrote:
>
> >     open DATA, ">>test.xml";    # append to file
>
>
> You should always, yes *always*, check the return value from open():
>
>    open DATA, '>>test.xml' or die "could not open 'test.xml'  $!";
>
>
> >         print DATA @lines [0];    # print the first element in the array
>
>
> You should enable warnings when developing Perl code!
>
>
> > while <$addr> {            # this is the input
>
>
> That is not Perl code. You are wasting the time of *thousands* of
> people around the world because you cannot be troubled to
> provide actual code!
>
> That's it. You've used up all your coupons.
>
> So long.
>
>
> -- 
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas


My apologies for not being able to reply to everyone. This would just make
this thread into a spaghetti. This is not a direct reply to Tad's last post
but is intended to cover the last few posts from all of you. Whilst I may
not agree with everyone's opinions I respect your views.

Just to confirm, our instructor did not ban anyone from using newsgroups. We
were given a task and are supposed to complete it. How we go about doing it
is up to us. There was no list of resources that we should or should not
refer to.

For those of us who write books, not everything is covered in them and hence
there exists a need for forums, newsgroups, mailing lists etc. Furthermore,
such resources are best utilised when a specific problem or need arises.
Everyone learns in different ways. Some may only need to read a description
of what a car is to be able to understand its purpose. Others may need to
actually drive one. Some ppl read a book from start to finish, others skip
around to parts of interest or on a need to know basis.

I am very much against plagiarism and would not expect anyone to give me an
answer. Consequently, I had no problem saying that I'm working on a homework
related task. Mind you, this is but a component of it and I have tried to
word it in such a way as not to give myself an outright answer. I have in
the past read some of your columns Randal [not to mention the books]. I just
didn't take it too well with your accusations. Oh, and I doubt I'll be
applying for work where you are - it's not my area of interest. :)

So pls feel free to flame me when my search for clues is wasting your time
cause the code examples I provide are irrelevant but spare yourself from
judging the way in which I do my search. There will be those who support the
Monarchy and others who support the Republic. I'm probably somewhere in the
middle.

Anyway, that's just my opinion, I hope I have not offended anyone.

Back to the code for those who are still interested.
I am only including the below code examples as they seem to be the only ones
which are relevant [or maybe that's just my poor newbie judgement].

The below is done using sockets and I have the server and the client working
without a prob. The client passes the correct data to the server and the
server writes it to a file [or most of the data]. So I'm a bit stomped as to
why it's not a 100% correct.

Code extract - server script:
************
sub fileupdate {
    open DATA, ">>test.xml" or die "Could not open test.xml $!\n";        #
open file file to append data to
        print DATA @lines;
# add the data stored in the array
    close DATA;
# close the file
}
 ...
 ...
while <$addr> {                    # reads input from client
    print $_;                            # this prints to the screen the
first line of the file passed by the client
    @lines <$addr>;                # I want this array to capture the whole
file passed from the client
}
fileupdate ();                         # calling function
************

Q: Why isn't line 1 passed into the array?
print $_ echoes line 1 on the server side [so we know it's been received]
and 'cat FILE_B' only shows:
line 2
line 3



Everything was working fine when I only had this:
************
while <$addr> {
    open DATA, ">>test.xml" or die "Could not open test.xml $!\n";
        print DATA $_;
    close DATA;
}
************

For example, 'cat FILE_B' would correctly show:
line 1
line 2
line 3

FILE_A passed by the client has
line 1
line 2
line 3
as its contents.


Does this make sense?
Thanks.






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

Date: Wed, 15 Oct 2003 06:27:20 GMT
From: "John" <no@spam.here>
Subject: Re: How to update entries in a file
Message-Id: <cN5jb.151455$bo1.108748@news-server.bigpond.net.au>


"Bart Lateur" <bart.lateur@pandora.be> wrote in message
news:gcfoovsnkqmoe0910kfn6o0gmqpsdu5nm5@4ax.com...
> John wrote:
>
> >Yes it is meant to be XML formatted. Unfortunately, I forgot to mention
that
> >I am unable to use any of the CPAN modules. :(
>
> You may just as well forget about getting any help, then. We're not
> going to reinvent such huge wheels just because you can't use modules.
>
> My advice would have been to look at AnyData, or DBI+DBD::AnyData, plus
> AnyData::Format::XML, to directly manipulate XML as if it was a
> database. (I've not tried it myself, though.)
>
> p.s. At least look at the XML::SAX::PurePerl stuff, as it doesn't
> require compilation/installation. At the very least you could steal some
> ideas. It's the rough route, though.
>
> -- 
> Bart.

Thanks Bart. I am actually looking at XML::Parser right now. Will pursue the
ones you suggested as well.




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

Date: Wed, 15 Oct 2003 07:01:06 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to update entries in a file
Message-Id: <c102afff425251afb01103c4647b3079@news.teranews.com>

>>>>> "Tassilo" == Tassilo v Parseval <tassilo.parseval@rwth-aachen.de> writes:

Tassilo> Maybe he isn't cheating. Finding out where to get help might well be
Tassilo> within the specifications of the excercise.

I'll believe that only if his instructor comes in here and
acknowledges it.  Until then, I'm not holding my breath. :)

Tassilo>  Actually and when it comes
Tassilo> to programming, it's the single most important thing you can learn:
Tassilo> knowing where to get the required information. This might be either
Tassilo> through documentation, tutorials, examples or even newsgroups.

But you should still understand the basics, and not run to get help at
the first sign of weakness.

>> You should hope I'm never the hiring manager at any future job to
>> which you apply.  I'll walk you out the door so fast you won't know
>> what hit you.

Tassilo> Ohoo. And I was under the impression that those employees who
Tassilo> get the job done are the most valuable ones (from a
Tassilo> shareholder-point-of-view).  Even when they cheat. Alas, I
Tassilo> cheat when it solves a problem for me. :-)

I'm sorry, I hire people that can solve basic tasks on their own, and
use resources for the advanced tasks. This was not an advanced task.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 14 Oct 2003 20:08:09 -0700
From: reneap@hotmail.com (Ren Patterson)
Subject: Re: Perl scripts for Unix on my windows machine
Message-Id: <2e13d330.0310141908.6cd00b57@posting.google.com>

Hi thanks for replying

none of these system(), exec(), ``, qx//, or a pipe open().

seem to be on my cgi-perl Unix scripts. Does that mean they should be
able to run from my Windows web server cgi-bin folder? thanks.


tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnbooug4.59v.tadmc@magna.augustmail.com>...
> Ren Patterson <reneap@hotmail.com> wrote:
> 
> > Hi newbie question:
>      ^^^^^^^^^^^^^^^
> 
> Who is that?
> 
> 
> > I have a few perl scripts made for Unix that I would like to use
> > either on my windows server or apache on my windows PC if I must
> > install apache. 
> 
> 
> You never need a web server to run Perl programs.
> 
> You (almost) always need a web server to run CGI programs,
> regardless of what programming language you choose to
> write them in.
> 
> Perl is not CGI.
> 
> CGI is not Perl.
> 
> 
> > Is there a foreknown reason why the Unix scripts would
> > not work in these environments?
> 
> 
> Yes, if it "shells out" to call system-specific external programs
> via system(), exec(), ``, qx//, or a pipe open().
> 
> Do your Perl programs use any of those?


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

Date: Tue, 14 Oct 2003 22:31:27 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Perl scripts for Unix on my windows machine
Message-Id: <slrnbopfsf.6f3.tadmc@magna.augustmail.com>

Ren Patterson <reneap@hotmail.com> wrote:


> Hi thanks for replying


If you really mean that, then please start quoting your
followups properly.


> none of these system(), exec(), ``, qx//, or a pipe open().
> 
> seem to be on my cgi-perl Unix scripts. Does that mean they should be
> able to run from my Windows web server cgi-bin folder? 


Probably, though there _are_ a few less obvious potential problems.

What happened when you tried it?



[ snip TOFU ]

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


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

Date: Wed, 15 Oct 2003 02:08:45 GMT
From: "David Oswald" <djo@pacifier.com>
Subject: Re: Please help re Perl script modification
Message-Id: <N_1jb.13561$YO5.6158433@news3.news.adelphia.net>


"Ron M." <rmorgan7@austin.rr.com> wrote.
[given...]
> perl -i.bak -pe 's/oldstring/newstring/g' `find . -name *.html\*`
>
> My question is this:  the script creates a backup of EVERY file with
> the suffix ".bak" and I don't want it to do this.  How do I modify the
> above script so that this won't happen?

s/\.bak//






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

Date: Tue, 14 Oct 2003 22:40:11 -0500
From: ty <takashiyyy@yahoo.com>
Subject: send e-mail and attachment
Message-Id: <3F8CC19B.20682F52@yahoo.com>

Could anyone tell me how to send e-mail and attachment (a text file) by
Perl?

I used codes  like these:

$to="takashiyyy\@yahoo.com";
$from ="anotherAdress\@yahoo.com";
$subject = "test";
$content = "this is a test";

open (MAIL, "|/usr/sbin/sendmail -t");

print MAIL "TO: $to \nFrom: $from: \n";
print MAIL "Subject:  $subject \n";
print MAIL  "$content  \n";
close(MAIL);


but how can I attache a file  (text file)?

thank you.

takashi



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

Date: Wed, 15 Oct 2003 05:16:31 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: send e-mail and attachment
Message-Id: <mbudash-C3AC6F.22163014102003@typhoon.sonic.net>

In article <3F8CC19B.20682F52@yahoo.com>, ty <takashiyyy@yahoo.com> 
wrote:

> Could anyone tell me how to send e-mail and attachment (a text file) by
> Perl?
> 
> I used codes  like these:
> 
> $to="takashiyyy\@yahoo.com";
> $from ="anotherAdress\@yahoo.com";
> $subject = "test";
> $content = "this is a test";
> 
> open (MAIL, "|/usr/sbin/sendmail -t");
> 
> print MAIL "TO: $to \nFrom: $from: \n";
> print MAIL "Subject:  $subject \n";
> print MAIL  "$content  \n";
> close(MAIL);
> 
> 
> but how can I attache a file  (text file)?
> 
> thank you.
> 
> takashi
> 

use MIME::Lite;

-- 
Michael Budash


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

Date: Wed, 15 Oct 2003 09:00:41 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: send e-mail and attachment
Message-Id: <pan.2003.10.15.05.33.40.691784@aursand.no>

On Tue, 14 Oct 2003 22:40:11 -0500, ty wrote:
> Could anyone tell me how to send e-mail and attachment (a text file) by
> Perl?

You should take a look related modules on CPAN, preferrably MIME::Lite.

> I used codes  like these:
> 
> $to="takashiyyy\@yahoo.com";
> $from ="anotherAdress\@yahoo.com";
> $subject = "test";
> $content = "this is a test";

Hint:  Use - whenever possible - "single" apostrophes (can't remember the
correct name for it now).  That way you don't have to think about escaping
special characters when there aren't any;

  my $to   = 'takashiyyy@yahoo.com';
  my $from = 'anotherAddress@yahoo.com';

> open (MAIL, "|/usr/sbin/sendmail -t");

What happens when something goes wrong?  What does your script do?  Nada?
Like nothing wrong ever happened?  That's a bad idea.

Have a look, as I said, at MIME::Lite.  It's a nice module.


-- 
Tore Aursand <tore@aursand.no>


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

Date: 14 Oct 2003 13:27:53 -0700
From: usenet@baccus.ca (Grant)
Subject: TCP close_wait problem
Message-Id: <e43eeb25.0310141227.6f72baae@posting.google.com>

Hi Everyone,

A little background to begin with. In my company, I've been given the
task of resolving a disconnection issue between a TCP probe scripted
in Perl, and a W2K app. I've barely touched Perl in the past, so
"right into the fire..." so-to-speak.

The Perl script resides on a Solaris 8 box, using Perl 5.8.0. Since
I've done a bit of C coding in the past, I've been able to determine
what the code is doing. It's a multithreaded script that opens a
socket to a number of W2K servers and reads data that is spit out from
an app on the W2K servers (data is dumped to port 3000 on its own
machine, a socket connection is made to this port, and the data is
picked up). The data then is dumped into a Queue from all operating
threads, then piped into another probe for further processing.

The problem occurs when the app on the W2K box initiates a disconnect.
I installed Windump on the W2K server, and saw that the app does send
a FIN and ACK, and does recieve an ACK back from the Perl probe, but
the FIN and ACK from the probe are never sent to the W2K server. Thus,
the W2K machine is stuck in a FIN_WAIT_2 state, and the Solaris
machine in a CLOSE_WAIT state. The states remain until the Perl probe
reaches a TCP inactivity timeout of 10 minutes (this condition is
explicitly checked within the code). At this point, an explicit call
to close the socket occurs. The connection is torn down, and the probe
reinitiates a connection back to the W2K server.

Adjusting the timeout value lower is not an option. It is possible
that the connection could be inactive (ie. no data sent) for up to 7
minutes, which is within normal operating parameters. The bottom line
is that if I lower it below that, I will have unneccessary inactivity
alarms come up throughout the day. But I need to have the probe
reconnect almost immediately, as the data that is sent is time
sensitive. In case you are wondering, the W2K app initiates a
disconnect each day in order to restart itself and compact a database
it uses.

I'm fairly certain the problem is not on the W2K side of the
connection, as there currently is a C probe running on another Solaris
machine that essentially does the same thing, and the TCP teardown is
done properly.

After reading that there was a setsockopt function, I thought there
would be a way to query the state of socket, but there isn't one that
I can find. I then thought I could make a system call, run netstat,
grep the IP that is used in the thread in question, search for
"CLOSE_WAIT" and if it exists, close the socket. But I kept saying to
myself that there has to be a more elegant way of dealing with this.

As mentioned earlier, the script is using Perl 5.8.0, along with the
threads module (and Threads::Queue which uses threads). I'm not really
sure how to determine if I'm running the proper threads module or not.
 When I do a perl -V, I get this as part of the output:

usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define

Any and all help would be apprciated... I'm somewhat leary on posting
the code, as it wasn't my company that developed it (vendor support
isn't an option, which brings me here), but if it will shed more light
on this problem, I will.

Thanks a bunch in advance,


   Grant



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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

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


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