[30445] in Perl-Users-Digest
Perl-Users Digest, Issue: 1688 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 4 00:09:39 2008
Date: Thu, 3 Jul 2008 21:09:05 -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 Thu, 3 Jul 2008 Volume: 11 Number: 1688
Today's topics:
Re: comp.lang.perl.misc pollution <res@ausics.net>
Re: comp.lang.perl.misc pollution sln@netherlands.com
Re: comp.lang.perl.misc pollution sln@netherlands.com
Re: comp.lang.perl.misc pollution sln@netherlands.com
Re: comp.lang.perl.misc pollution sln@netherlands.com
Re: comp.lang.perl.misc pollution sln@netherlands.com
Re: comp.lang.perl.misc pollution sln@netherlands.com
Re: comp.lang.perl.misc pollution <jimsgibson@gmail.com>
Re: comp.lang.perl.misc pollution <m@rtij.nl.invlalid>
Re: comp.lang.perl.misc pollution <benkasminbullock@gmail.com>
Formatting ASCII to be read by Windows NotePad <bdwhite@gmail.com>
Re: Formatting ASCII to be read by Windows NotePad <RedGrittyBrick@SpamWeary.foo>
Re: Formatting ASCII to be read by Windows NotePad <spamtrap@dot-app.org>
Re: Formatting ASCII to be read by Windows NotePad <wgumgfy@gmail.com>
Re: Formatting ASCII to be read by Windows NotePad <bdwhite@gmail.com>
Re: Formatting ASCII to be read by Windows NotePad <spamtrap@dot-app.org>
Re: kill process when file number reached... <whynot@pozharski.name>
Threads don't seem to work as advertised <Mark.Seger@hp.com>
Re: Threads don't seem to work as advertised <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 4 Jul 2008 10:17:32 +1000 (EST)
From: Res <res@ausics.net>
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <Pine.LNX.4.64.0807041014240.12310@ebfjryy.nhfvpf.arg>
On Thu, 3 Jul 2008, sln@netherlands.com wrote:
>
> On Thu, 3 Jul 2008 10:40:28 -0700 (PDT), nolo contendere <simon.chao@fmr.com> wrote:
>
>> This isn't about Perl, but it is about this newsgroup. I'm becoming
>> irritated by the spam that I see (I use Google Groups) and was
This is funny, he uses a news service that is internationally the biggest
spammer problem (I cant reply to him because we like many reject all
googlegroups posts), firstly he should change usenet services, then a lot
of spam will drop off...
>> wondering if someone could suggest a great free newsreader, as well as
>> where and how to acquire it.
I dont see spam, partly because of above and secondly because i use this
group via a mailing list which has S.A and other filtering :)
--
Cheers
Res
--- Usenet policy, and why I might ignore you ---
1/ GoogleGroups are UDP'd on my nntp server. If you use them, don't
waste your time or energy replying to me.
2/ If only cleanfeed filtered out trolls as well as spam, usenet would be
a nicer place.
------------------------------
Date: Thu, 03 Jul 2008 20:27:17 GMT
From: sln@netherlands.com
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <efdq64dvlmtors6n552lsvkndovafhitoj@4ax.com>
On Thu, 3 Jul 2008 10:40:28 -0700 (PDT), nolo contendere <simon.chao@fmr.com> wrote:
>This isn't about Perl, but it is about this newsgroup. I'm becoming
>irritated by the spam that I see (I use Google Groups) and was
>wondering if someone could suggest a great free newsreader, as well as
>where and how to acquire it.
Free Agent is good, if you can find it. Forte Agent 2.0 is great.
------------------------------
Date: Thu, 03 Jul 2008 20:27:42 GMT
From: sln@netherlands.com
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <pi6q64lc1ursqv6r8fp151mmvp2g37buao@4ax.com>
On Thu, 3 Jul 2008 10:40:28 -0700 (PDT), nolo contendere <simon.chao@fmr.com> wrote:
>This isn't about Perl, but it is about this newsgroup. I'm becoming
>irritated by the spam that I see (I use Google Groups) and was
>wondering if someone could suggest a great free newsreader, as well as
>where and how to acquire it.
Free Agent if you can still find it. I use Agent from Forte.
------------------------------
Date: Thu, 03 Jul 2008 20:27:43 GMT
From: sln@netherlands.com
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <jq6q64lrt7e1gaarl0h000sbtpa67qtfik@4ax.com>
On Thu, 3 Jul 2008 10:40:28 -0700 (PDT), nolo contendere <simon.chao@fmr.com> wrote:
>This isn't about Perl, but it is about this newsgroup. I'm becoming
>irritated by the spam that I see (I use Google Groups) and was
>wondering if someone could suggest a great free newsreader, as well as
>where and how to acquire it.
Free Agent is a good one if you can find it.
------------------------------
Date: Thu, 03 Jul 2008 20:27:43 GMT
From: sln@netherlands.com
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <0c8q64dpl4sfkvcenkesmv1023qqq6bkbq@4ax.com>
On Thu, 3 Jul 2008 10:40:28 -0700 (PDT), nolo contendere <simon.chao@fmr.com> wrote:
>This isn't about Perl, but it is about this newsgroup. I'm becoming
>irritated by the spam that I see (I use Google Groups) and was
>wondering if someone could suggest a great free newsreader, as well as
>where and how to acquire it.
Free Agent is good if you can still find it.
------------------------------
Date: Thu, 03 Jul 2008 20:27:43 GMT
From: sln@netherlands.com
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <367q64lg8utr172l0aduuqnal6ri3g4ufj@4ax.com>
On Thu, 3 Jul 2008 10:40:28 -0700 (PDT), nolo contendere <simon.chao@fmr.com> wrote:
>This isn't about Perl, but it is about this newsgroup. I'm becoming
>irritated by the spam that I see (I use Google Groups) and was
>wondering if someone could suggest a great free newsreader, as well as
>where and how to acquire it.
You could use Free Agent. I'm sure its still around.
------------------------------
Date: Thu, 03 Jul 2008 20:27:43 GMT
From: sln@netherlands.com
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <de8q64d3nvt00mgtgjru3bisrn10gcbq2d@4ax.com>
On Thu, 3 Jul 2008 10:40:28 -0700 (PDT), nolo contendere <simon.chao@fmr.com> wrote:
>This isn't about Perl, but it is about this newsgroup. I'm becoming
>irritated by the spam that I see (I use Google Groups) and was
>wondering if someone could suggest a great free newsreader, as well as
>where and how to acquire it.
Free Agent is good, if you can find it.
------------------------------
Date: Thu, 03 Jul 2008 13:39:15 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <030720081339150573%jimsgibson@gmail.com>
In article
<3f449df2-0b0e-43d6-9fe3-eda35fef6915@e39g2000hsf.googlegroups.com>,
nolo contendere <simon.chao@fmr.com> wrote:
> This isn't about Perl, but it is about this newsgroup. I'm becoming
> irritated by the spam that I see (I use Google Groups) and was
> wondering if someone could suggest a great free newsreader, as well as
> where and how to acquire it.
Besides a decent newsreader, you will need a Usenet news feed, because
AFAIK Google does not provide Usenet articles over the NNTP protocol.
Your local ISP may provide Usenet, although some are starting to drop
it because Usenet can carry (gasp!) porn. There are also free and paid
providers of Usenet you can use with most newsreaders. In fact, all
newsreaders with which I am familiar will require connection to an NNTP
server.
Also, the amount of spam may depend upon the news feed you select, as
the NNTP providers can filter out spam before it gets to you. I
recently switched to News.Individual.net because they provide
inexpensive NNTP access with very little spam. Others I have used in
the past are teranews.com and usenet.com. See here for more:
<http://directory.google.com/Top/Computers/Usenet/Feed_Services/>
Check <www.newsreaders.com> for newsreaders.
--
Jim Gibson
------------------------------
Date: Thu, 3 Jul 2008 23:36:10 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <pan.2008.07.03.21.36.10@rtij.nl.invlalid>
On Thu, 03 Jul 2008 10:40:28 -0700, nolo contendere wrote:
> This isn't about Perl, but it is about this newsgroup. I'm becoming
> irritated by the spam that I see (I use Google Groups) and was wondering
> if someone could suggest a great free newsreader, as well as where and
> how to acquire it.
Check out Xnews. It's a bit quirky on key assignments, but was my
newsreader of choice before I left Windows.
M4
------------------------------
Date: Fri, 4 Jul 2008 00:26:50 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: comp.lang.perl.misc pollution
Message-Id: <g4jqoa$ra7$1@cgi-ml.accsnet.ne.jp>
On Thu, 03 Jul 2008 10:40:28 -0700, nolo contendere wrote:
> This isn't about Perl, but it is about this newsgroup. I'm becoming
> irritated by the spam that I see (I use Google Groups) and was
> wondering if someone could suggest a great free newsreader, as well as
> where and how to acquire it.
I've been using the Pan newsreader, which is free, for about two years.
It works on Windows and Linux. It has a lot of features, but a few bugs
remain in the current version. It is very good at filtering out unwanted
posts (you can use regexes etc.)
More information is here:
http://pan.rebelbase.com/
There is also a user group you can access via Gmane.
Outlook Express on Windows is another option. It is fairly effective at
filtering and is very easy to use. I understand that the Evolution email
client has a news reading facility too, although I've never tried it.
------------------------------
Date: Thu, 3 Jul 2008 14:02:36 -0700 (PDT)
From: UnRiel <bdwhite@gmail.com>
Subject: Formatting ASCII to be read by Windows NotePad
Message-Id: <304e08f4-3114-419e-a2fe-a4347810867e@y21g2000hsf.googlegroups.com>
I have a nice PERL script I use to generate CISCO configurations, but
when I FTP the files to my Windows XP PC and try to read them in
Notepad, there is clearly no line wrap that Notepad understands. If I
otherwise read the file into WordPad first, save the file, then open
into Notepad, the formatting presents correctly.
I have generated the ASCII files using a simple 'print' command to a
file I generate using an 'open' command. I have tried both the newline
\n and the carriage return \r format characters.
Before I begin experiment with other characters, does anyone have a
solution for me gained from similar experience?
Thanks!
------------------------------
Date: Thu, 03 Jul 2008 22:08:20 +0100
From: RedGrittyBrick <RedGrittyBrick@SpamWeary.foo>
Subject: Re: Formatting ASCII to be read by Windows NotePad
Message-Id: <6O6dnbGL-ZVWovDVRVnyhQA@bt.com>
UnRiel wrote:
> I have a nice PERL script I use to generate CISCO configurations, but
> when I FTP the files to my Windows XP PC and try to read them in
> Notepad, there is clearly no line wrap that Notepad understands. If I
> otherwise read the file into WordPad first, save the file, then open
> into Notepad, the formatting presents correctly.
>
> I have generated the ASCII files using a simple 'print' command to a
> file I generate using an 'open' command. I have tried both the newline
> \n and the carriage return \r format characters.
>
> Before I begin experiment with other characters, does anyone have a
> solution for me gained from similar experience?
>
Use ASCII mode rather than binary when using FTP to transfer text files
from a Unix/Linux environment to a DOS/Windows environment. That way FTP
transforms line-endings to the ones needed by the target platform.
--
RGB
------------------------------
Date: Thu, 03 Jul 2008 18:00:08 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Formatting ASCII to be read by Windows NotePad
Message-Id: <m1tzf6d3x3.fsf@dot-app.org>
UnRiel <bdwhite@gmail.com> writes:
> I have a nice PERL script I use to generate CISCO configurations
No need to shout - neither Perl nor Cisco are acronyms.
> when I FTP the files to my Windows XP PC and try to read them in
> Notepad, there is clearly no line wrap that Notepad understands. If I
> otherwise read the file into WordPad first, save the file, then open
> into Notepad, the formatting presents correctly.
Transfer the files in text mode. That will translate the line endings
as needed.
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 3 Jul 2008 15:15:49 -0700
From: "Waylen Gumbal" <wgumgfy@gmail.com>
Subject: Re: Formatting ASCII to be read by Windows NotePad
Message-Id: <6d51coFtnnuU1@mid.individual.net>
Sherman Pendley wrote:
> UnRiel <bdwhite@gmail.com> writes:
>
> > I have a nice PERL script I use to generate CISCO configurations
>
> No need to shout - neither Perl nor Cisco are acronyms.
I don't think two all-caps words in a sentence that's otherwise properly
cased really constitutes shouting.
> > when I FTP the files to my Windows XP PC and try to read them in
> > Notepad, there is clearly no line wrap that Notepad understands. If
> > I
> > otherwise read the file into WordPad first, save the file, then open
> > into Notepad, the formatting presents correctly.
>
> Transfer the files in text mode. That will translate the line endings
> as needed.
While it is common to use ASCII mode one should still take care, as this
isn't always guarenteed to work. There used (still are?) issues with
this when uploading to MacOS based servers, for example.
--
wg
------------------------------
Date: Thu, 3 Jul 2008 16:49:50 -0700 (PDT)
From: UnRiel <bdwhite@gmail.com>
Subject: Re: Formatting ASCII to be read by Windows NotePad
Message-Id: <992d59c7-c983-495f-8521-85d17abcb213@d1g2000hsg.googlegroups.com>
On Jul 3, 5:08 pm, RedGrittyBrick <RedGrittyBr...@SpamWeary.foo>
wrote:
> UnRiel wrote:
> > I have a nice PERL script I use to generate CISCO configurations, but
> > when I FTP the files to my Windows XP PC and try to read them in
> > Notepad, there is clearly no line wrap that Notepad understands. If I
> > otherwise read the file into WordPad first, save the file, then open
> > into Notepad, the formatting presents correctly.
>
> > I have generated the ASCII files using a simple 'print' command to a
> > file I generate using an 'open' command. I have tried both the newline
> > \n and the carriage return \r format characters.
>
> > Before I begin experiment with other characters, does anyone have a
> > solution for me gained from similar experience?
>
> Use ASCII mode rather than binary when using FTP to transfer text files
> from a Unix/Linux environment to a DOS/Windows environment. That way FTP
> transforms line-endings to the ones needed by the target platform.
>
> --
> RGB
Thanks to all. The ASCII mode FTP worked.
------------------------------
Date: Thu, 03 Jul 2008 20:30:46 -0400
From: Sherman Pendley <spamtrap@dot-app.org>
Subject: Re: Formatting ASCII to be read by Windows NotePad
Message-Id: <m14p76jxs9.fsf@dot-app.org>
"Waylen Gumbal" <wgumgfy@gmail.com> writes:
> Sherman Pendley wrote:
>> UnRiel <bdwhite@gmail.com> writes:
>>
>> > I have a nice PERL script I use to generate CISCO configurations
>>
>> No need to shout - neither Perl nor Cisco are acronyms.
>
> I don't think two all-caps words in a sentence that's otherwise properly
> cased really constitutes shouting.
It's shouting those words.
>> Transfer the files in text mode. That will translate the line endings
>> as needed.
>
> While it is common to use ASCII mode one should still take care, as this
> isn't always guarenteed to work. There used (still are?) issues with
> this when uploading to MacOS based servers, for example.
Such as?
sherm--
--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Thu, 03 Jul 2008 22:34:09 +0300
From: Eric Pozharski <whynot@pozharski.name>
Subject: Re: kill process when file number reached...
Message-Id: <h6mvj5xqg5.ln2@carpet.zombinet>
onlineviewer <lancerset@gmail.com> wrote:
> Hello All,
> I am trying to run a tcpdump and have perl kill the tcpdump once 10
> files have been created by the tcpdump. Here is my code, not sure...if
> my logic is screwy
Your logic isn't screwy, it's misunderstanding.
> system "tcpdump -i bge1 -s0 -w /tmp/file.out -C 1";
I'm not the B<tcpdump> expert, but B<if> my understanding of tcpdump(8)
is right, then you'll never get out of B<system>. If you use I<-c> (as
smallpond suggested) then B<tcpdump> B<will> exit (apparently you don't
need B<kill> in that case).
OK, if you really want to write shell scripts in Perl do it in Perl.
> sleep 2;
I believe, you missed B<sleep> inside loop.
> while(true){
Show your B<real> code! What the fsck is that "true"?
> @array1 = `ls -l /tmp | grep files`;
> $result=@array1+1;
$result = (() = </tmp/file.out.*>) + 1;
(He-he, I was beaten hardly a week before for missing that.)
> if ($result > 3){
if((() = </tmp/file.out.*>) > 2)
and you don't need to increment.
> $x=`ps -ef | awk '/tcpdump/ && !/awk/ {print
> $2}'`;
$x = (map { m{(\d+)}; }
map { readlink; }
</proc/[0-9]*/exe>)[0];
Since you seem to be root, you'll have permissions to read those
symlinks.
> @y=split(' ', $x);
> $c=$y[1];
$c = (split m{\s+}, $x)[1];
> system "kill -9 $c";
kill 9, $c;
waitpid $c, 0;
> print "killing tcpdump...";
Use B<Proc::Background> and you'll automagically would know the PID of
B<tcpdump>. If you don't want to bother with B<Proc::Background>, then
C<perldoc perlfork> is good reading.
> }else{
> print "!!!\n";
> exit;
Either that must be B<last> or you don't need the second B<exit>.
Anyway you don't need the second B<exit> since you've better just fall
out of script.
> }
> exit;
And as ever: C<use strict> and C<use warnings> are your best friends.
Lexical filehandles and 3-arg B<open> are your good friends.
--
Torvalds' goal for Linux is very simple: World Domination
------------------------------
Date: Thu, 03 Jul 2008 16:49:19 -0400
From: Mark Seger <Mark.Seger@hp.com>
Subject: Threads don't seem to work as advertised
Message-Id: <g4je0j$q4q$1@usenet01.boi.hp.com>
... but then again it something silly I'm doing.
I'm trying a variety of the basic and thing like creating threads works
just fine - in fact that's what I used to test my implementation of
monitoring procosses by thread in collectl and so I then used collectl
to test my implementation when things didn't look quite right.
Specifically, the is-running() method doesn't appear to be there because
when I try to execute it perl tells me it can't find it. this is a
standard RHEL4.2 release and perl 5.8.5. But I think I may be able to
live with that if I can get other things to work.
First a couple of words about what I'm doing. I have a main script that
sits in an infinite loop, sets an alarm for 5 seconds, fires off a
thread which itself sleeps for 1 second and exits. In other words
(leaving off the sigalarm routine and some intermediate print statements):
$secs=5*1000000;
while (1)
{
Time::HiRes::ualarm($secs, 0);
my $thr=threads->create('dothread');
sleep 100;
@running=threads::list(threads::running);
printf "Awake at: %s State: %d\n", getSecs(), scalar(@running);
}
sub dothread
{
my $secs=1000000;
sleep 2;
}
This works just fine, but what I really want to be able to do in the
mainline is figure out if my thread hung. The documentation says that
threads::list(threads::running) will return a list of the running
threads. So I did the following:
@running=threads::list(threads::running);
printf "Running %d\n", scalar(@running);
right after my main timer when off in the main loop and not only was the
size of @running not zero like I expected it to be since there weren't
any running threads, every time I called it it incremented by 1. How
can that be if there are no threads running? I even tried an undef of
@results right before setting it just to be sure and it keeps growing.
To make sure there weren't any other threads running I ran collectl
during the test and you can even see threads coming and going as from
the following:
# PROCESS SUMMARY (faults are /sec)
# PID User PR PPID S VSZ RSS CP SysT UsrT Pct
AccuTime MajF MinF Command
21:00:55 14681 root 16 6533 S 119M 7M 2 0.00 0.00 0
0:00.03 0 0 /usr/bin/perl
21:00:56 14681 root 16 6533 S 130M 7M 2 0.00 0.00 0
0:00.03 0 175 /usr/bin/perl
21:00:56 14723+ root 17 14681 S 130M 7M 2 0.00 0.00 0
0:00.00 0 1 ipmi-thread.pl
21:00:57 14681 root 16 6533 S 130M 7M 2 0.00 0.00 0
0:00.03 0 0 /usr/bin/perl
21:00:58 14681 root 16 6533 S 130M 7M 2 0.00 0.00 0
0:00.03 0 0 /usr/bin/perl
21:00:59 14681 root 16 6533 S 130M 7M 2 0.00 0.00 0
0:00.03 0 0 /usr/bin/perl
21:01:00 14681 root 16 6533 S 130M 7M 2 0.00 0.00 0
0:00.03 0 0 /usr/bin/perl
21:01:01 14681 root 16 6533 S 141M 8M 2 0.00 0.00 0
0:00.03 0 175 /usr/bin/perl
21:01:01 14724+ root 17 14681 S 141M 8M 2 0.00 0.00 0
0:00.00 0 1 ipmi-thread.pl
21:01:02 14681 root 16 6533 S 141M 8M 2 0.00 0.00 0
0:00.03 0 0 /usr/bin/perl
My main process is pid 14681 and you can see it create a thread with a
tid of 14723 which I call a pid in collectl to keep the display neater).
After a second it goes away like it should and 5 seconds later a new
thread, 14724 starts up and a second later it exits.
So why does threads::list(threads::running) return a growing array.
Then I had another thought. Since I can get the tid of a thread maybe I
can see if that process still exists so I looked at '$thr->tid()', but
instead of returning a tid like it says, it simply returns an
incrementing number starting at 1 which does me no good trying to map it
to a real tid. Should I be able to get the real tid of a thread?
Finally, as one piece of good news, if I set an alarm within the thread,
it does appear to wake me up when it should without interfering with the
alarm being delivered to the main line code so perhaps I have a
mechanism I can work with after all - I'm basically trying to execute a
command in the thread and figure out if it hangs.
But never-the-less, if I'm doing something wrong with the threads
package I'd sure like to know what it is.
sorry for being so long winded...
-mark
------------------------------
Date: Fri, 4 Jul 2008 02:37:54 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Threads don't seem to work as advertised
Message-Id: <igb0k5-ds02.ln1@osiris.mauzo.dyndns.org>
Quoth Mark Seger <Mark.Seger@hp.com>:
> ... but then again it something silly I'm doing.
>
> I'm trying a variety of the basic and thing like creating threads works
> just fine - in fact that's what I used to test my implementation of
> monitoring procosses by thread in collectl and so I then used collectl
> to test my implementation when things didn't look quite right.
>
> Specifically, the is-running() method doesn't appear to be there because
> when I try to execute it perl tells me it can't find it. this is a
> standard RHEL4.2 release and perl 5.8.5. But I think I may be able to
> live with that if I can get other things to work.
>
> First a couple of words about what I'm doing. I have a main script that
> sits in an infinite loop, sets an alarm for 5 seconds, fires off a
> thread which itself sleeps for 1 second and exits. In other words
> (leaving off the sigalarm routine and some intermediate print statements):
>
> $secs=5*1000000;
> while (1)
> {
> Time::HiRes::ualarm($secs, 0);
> my $thr=threads->create('dothread');
> sleep 100;
> @running=threads::list(threads::running);
> printf "Awake at: %s State: %d\n", getSecs(), scalar(@running);
> }
>
> sub dothread
> {
> my $secs=1000000;
> sleep 2;
> }
>
> This works just fine, but what I really want to be able to do in the
> mainline is figure out if my thread hung. The documentation says that
> threads::list(threads::running) will return a list of the running
> threads. So I did the following:
> @running=threads::list(threads::running);
> printf "Running %d\n", scalar(@running);
> right after my main timer when off in the main loop and not only was the
> size of @running not zero like I expected it to be since there weren't
> any running threads, every time I called it it incremented by 1. How
> can that be if there are no threads running? I even tried an undef of
> @results right before setting it just to be sure and it keeps growing.
Are you reading your local copy of the documentation, or a copy on the
web? If you're reading a non-local copy, you may need to upgrade your
threads: is_running and threads::running were introduced in 1.34,
whereas for instance 5.8.8 came with 1.07.
Ben
--
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based
on the strictest morality. [Samuel Butler, paraphrased] ben@morrow.me.uk
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V11 Issue 1688
***************************************