[25072] in Perl-Users-Digest
Perl-Users Digest, Issue: 7322 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 27 14:05:51 2004
Date: Wed, 27 Oct 2004 11:05:10 -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, 27 Oct 2004 Volume: 10 Number: 7322
Today's topics:
Re: Common file operations (Seymour J.)
Re: Compiling or Hiding Perl <ron.parker@povray.org>
Re: Compiling or Hiding Perl <uri@stemsystems.com>
Re: Compiling or Hiding Perl <flavell@ph.gla.ac.uk>
Re: Compiling or Hiding Perl <lwt0301@bellsouth.net>
Re: Compiling or Hiding Perl <ron.parker@povray.org>
Re: Compiling or Hiding Perl <nospam@nospam.com>
Re: Compiling or Hiding Perl <nospam@nospam.com>
Re: Compiling or Hiding Perl <nospam@nospam.com>
Re: Compiling or Hiding Perl <nospam@nospam.com>
Re: Compiling or Hiding Perl <uguttman@athenahealth.com>
FAQ 6.4: I put a regular expression into $/ but it didn <comdog@panix.com>
Re: FAQ 6.4: I put a regular expression into $/ but it <nobull@mail.com>
Re: Finding the size of a rather complicated hash-struc <usenet@morrow.me.uk>
How do I parse this Charactor? 2byte vs 1byte <nntp@rogers.com>
Re: How do I parse this Charactor? 2byte vs 1byte <karel@e-tunity.com>
Re: How do I parse this Charactor? 2byte vs 1byte <see@sig.invalid>
Re: How do I parse this page? <spam@merlyn.demon.co.uk>
how to kill a process initiated by system() (Howard)
Re: how to kill a process initiated by system() <ThomasKratz@REMOVEwebCAPS.de>
Re: how to kill a process initiated by system() (Anno Siegel)
Re: how to kill a process initiated by system() (Anno Siegel)
Re: how to kill a process initiated by system() <ThomasKratz@REMOVEwebCAPS.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 27 Oct 2004 12:15:20 -0300
From: "Shmuel (Seymour J.) Metz" <spamtrap@library.lspace.org.invalid>
Subject: Re: Common file operations
Message-Id: <417fc999$2$fuzhry+tra$mr2ice@news.patriot.net>
In <251020041625004613%jgibson@mail.arc.nasa.gov>, on 10/25/2004
at 04:25 PM, Jim Gibson <jgibson@mail.arc.nasa.gov> said:
>What computer language allows you to enter a partial file name and
>get a complete path?
REXX.
>Or do you mean you have a partial or relative path
>representation and you want to get the full, absolute path name?
Yes.
>If the latter, check out the File::Spec::Unix module or its brethren.
File::Spec::canonpath doesn't do it.
>[answered elsewhere in this thread]
Not really. What was elsewhere in the thread was that I could write
code to do it, using File::Find, which I had said I'd like to avoid. I
was looking for an equivalent to
if file = '' then file = 'forward+*'
CALL SysFileTree file, files, FOS
which returns an array of file names, including drive and directory
information.
[1] Well, close enough.
--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>
Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to spamtrap@library.lspace.org
------------------------------
Date: Wed, 27 Oct 2004 10:38:26 -0500
From: Ron Parker <ron.parker@povray.org>
Subject: Re: Compiling or Hiding Perl
Message-Id: <slrncnvg7i.or8.ron.parker@mail.parkrrrr.com>
On Wed, 27 Oct 2004 01:26:58 -0400, daniel kaplan wrote:
>
> in the end you have to research every possibilty....also as i said in an
> earlier post, when i researched this a year ago or so, i got my answer, but
> since am now looking into Perl i had to re-check. afert all things change
I don't think we'll be seeing any changes anytime soon to the cryptographers'
maxim that says it's impossible, on an untrusted system, to hide code while
making it executable. Whatever method you have in place to make it possible
for the processor to read and interpret your opcodes can be subverted to make
it possible for a potential "attacker" to read and interpret your opcodes.
The best you can do is make it difficult. Many people would tell you that
the mere fact that the code is written in Perl makes it sufficiently difficult
to read. If that's not good enough for you, consider porting your code to
APL.
This isn't a problem unique to Perl, either: I took a class in C# from one
of the more knowledgeable people in the .NET field, and when he introduced us
to one of the many available decompilers for the .NET bytecode, a lot of
people in the class got their panties in a bunch over the impossibility of
hiding code in .NET. His answer was that as soon as Microsoft has total
control over our computers, that problem will go away. Personally, I'm not
particularly overjoyed at that prospect, but at least it made the other
students happy enough to let him go on with the class.
--
#local R=rgb 99;#local P=R-R;#local F=pigment{gradient x}box{0,1pigment{gradient
y pigment_map{[.5F pigment_map{[.3R][.3F color_map{[.15red 99][.15P]}rotate z*45
translate x]}]#local H=pigment{gradient y color_map{[.5P][.5R]}scale 1/3}[.5F
pigment_map{[.3R][.3H][.7H][.7R]}]}}}camera{location.5-3*z}//only my opinions
------------------------------
Date: Wed, 27 Oct 2004 15:58:47 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Compiling or Hiding Perl
Message-Id: <x7zn2840iv.fsf@mail.sysarch.com>
>>>>> "L" == Laura <lwt0301@bellsouth.net> writes:
L> distributed code. It is no accident that products like Linux, Perl
L> and others are free, yet so difficult for the beginner to learn and
L> use. Whether it is conscious or unconscious, the programmers of
L> free software build into their work an innate difficulty for the
L> absolute novice. Of course, code is well organized and
L> occasionally well documented as a matter of pride, but little
L> effort is made to make it accessible to the beginner or even the
L> user who wants to use the software without dedicating a substantial
L> amount of time to becoming a "hacker". Again, follow the money
L> trail. Do a survey of how often you read the response "hire a
like i said, i was just waiting for more of your tripe. please stop
posting FUD like this. there are plenty of commercial proprietary
programs that are very difficult to learn. and programming in general,
regardless of the language (and none are really proprietary, you can get
free versions of almost any lang) is hard. so you blabbering about perl
being hard to learn is meaningless. perl is just as accessible
to beginners if you just use the right resources. usenet is not a
resource for most beginners in any area. books and tutorials and classes
are what beginners should be using. this is a PERL DISCUSSION GROUP, not
a teaching forum. but you won't get that as you seem to just want to
blather inane verbiage and just fill up distributed usenet disk space
with random noise.
eagerly awaiting your next worthless post,
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 27 Oct 2004 17:02:48 +0100
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: Compiling or Hiding Perl
Message-Id: <Pine.LNX.4.61.0410271700090.18459@ppepc56.ph.gla.ac.uk>
On Wed, 27 Oct 2004, Ron Parker wrote:
> This isn't a problem unique to Perl, either: I took a class in C# from one
> of the more knowledgeable people in the .NET field, and when he introduced us
> to one of the many available decompilers for the .NET bytecode, a lot of
> people in the class got their panties in a bunch over the impossibility of
> hiding code in .NET. His answer was that as soon as Microsoft has total
> control over our computers, that problem will go away. Personally, I'm not
> particularly overjoyed at that prospect, but at least it made the other
> students happy enough to let him go on with the class.
Hmmm, why is my irony detector making wild swings to and fro?
If that last remark carries even a grain of truth, then surely the
asylum is indeed being run by the inmates.
------------------------------
Date: Wed, 27 Oct 2004 12:19:23 -0400
From: Laura <lwt0301@bellsouth.net>
Subject: Re: Compiling or Hiding Perl
Message-Id: <10nviqg63to7c5f@news.supernews.com>
[deleted to save usenet disk space]
this is a PERL DISCUSSION GROUP, not
> a teaching forum. but you won't get that as you seem to just want to
> blather inane verbiage and just fill up distributed usenet disk space
> with random noise.
>
> eagerly awaiting your next worthless post,
>
> uri
>
cost of maintaining my post on usenet: $00.00 (rounded down to nearest
penny)
cost of my time for composing and posting it: $00.00
cost of your time to read and compose response: estimated $00.00
value of your entertaining response: priceless!
------------------------------
Date: Wed, 27 Oct 2004 11:23:32 -0500
From: Ron Parker <ron.parker@povray.org>
Subject: Re: Compiling or Hiding Perl
Message-Id: <slrncnvis4.p01.ron.parker@mail.parkrrrr.com>
On Wed, 27 Oct 2004 17:02:48 +0100, Alan J. Flavell wrote:
> On Wed, 27 Oct 2004, Ron Parker wrote:
>
>> This isn't a problem unique to Perl, either: I took a class in C# from one
>> of the more knowledgeable people in the .NET field, and when he introduced us
>> to one of the many available decompilers for the .NET bytecode, a lot of
>> people in the class got their panties in a bunch over the impossibility of
>> hiding code in .NET. His answer was that as soon as Microsoft has total
>> control over our computers, that problem will go away. Personally, I'm not
>> particularly overjoyed at that prospect, but at least it made the other
>> students happy enough to let him go on with the class.
>
> Hmmm, why is my irony detector making wild swings to and fro?
If you think that's ironic, I can't imagine what would happen if I told you
who paid for the class.
> If that last remark carries even a grain of truth, then surely the
> asylum is indeed being run by the inmates.
There's a bit of truth-stretching going on there, but there were those who
were mollified, at least a little, by the prospect of the Trusted Computing
Initiative solving all their problems. I guess going out of business solves
a lot of such problems.
--
#macro R(P)z+_(P)_(P)_(P+1)_(P+1)+z#end#macro Q(C,T)bicubic_patch{type 1u_steps
6v_steps 6R(1)R(3)R(5)R(7)pigment{rgb z}}#end#macro _(Y)#local X=asc(substr(C,Y
,1))-65;<T+mod(X,4)div(X,4)9>-2#end#macro O(T)Q("ABEFUQWS",T)Q("WSXTLOJN",T)#
end O(0)O(3)Q("JNKLCGCD",0)light_source{x 1}// ron.parker@povray.org
------------------------------
Date: Wed, 27 Oct 2004 13:02:43 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Compiling or Hiding Perl
Message-Id: <1098896605.806567@nntp.acecape.com>
"Tintin" <tintin@invalid.invalid> wrote in message
news:2u944dF28akduU1@uni-berlin.de...
> An attribution is what you'll see as the first line of this post, ie: the
> line that tells everyone else that the last comments were made by "daniel
> kaplan".
ah, i've just been "quoting" will make sure i do BOTH from now on
thanks
------------------------------
Date: Wed, 27 Oct 2004 13:04:42 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Compiling or Hiding Perl
Message-Id: <1098896725.37662@nntp.acecape.com>
"Laura" <lwt0301@bellsouth.net> wrote in message
news:10nvd9q7ss5j660@news.supernews.com...
> TOP POSTER!
>
> Reason for not top posting:
>
as i said, i had misundertood it earlier and was just QUOTING....now someone
actually explained it, and will make sure i d it
------------------------------
Date: Wed, 27 Oct 2004 13:07:14 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Compiling or Hiding Perl
Message-Id: <1098896876.586235@nntp.acecape.com>
"Laura" <lwt0301@bellsouth.net> wrote in message
news:10nvc4is88hqfac@news.supernews.com...
>Microsoft and Apple and like minded corporations attempt to make
> software that is easy to use but difficult to hack into. They make their
> money selling software, but they lose money on the support end when the
> support is included in the price of the software
have you ever had to go to microsoft for tech support? credit card first!
even when it's a bug (most times) and they end up not putting through the
charge, but you go through the whole process anyway.
------------------------------
Date: Wed, 27 Oct 2004 13:10:39 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: Compiling or Hiding Perl
Message-Id: <1098897082.214599@nntp.acecape.com>
"Peter Hickman" <peter@semantico.com> wrote in message
news:417f796c$0$11938$afc38c87@news.easynet.co.uk...
We are on the threshold of version 6 and it is still not here and to be
honest I
> don't ever think it will exist. Lets face it this has never been a
requirement
> of the language and never will be. There are many more productive things
for the
> developers to undertake than hiding the code.
>
> It will never happen.
thanks
------------------------------
Date: Wed, 27 Oct 2004 13:19:28 -0400
From: Uri Guttman <uguttman@athenahealth.com>
Subject: Re: Compiling or Hiding Perl
Message-Id: <m3fz40yt7j.fsf@linux.local>
>>>>> "L" == Laura <lwt0301@bellsouth.net> writes:
L> cost of maintaining my post on usenet: $00.00 (rounded down to nearest
L> penny)
cost of wasting other people's time with your crap: priceless
L> cost of my time for composing and posting it: $00.00
your time isn't worth much from what you display of your perl skills
here.
L> cost of your time to read and compose response: estimated $00.00
L> value of your entertaining response: priceless!
nah, i entertain all of perldom and exact my fees. part of my job is
pointing out clowns like you. that i do for free as a public service.
now, please post more inanities. i will have to collect them into a page
in your dishonor if you keep it up.
uri
------------------------------
Date: Wed, 27 Oct 2004 16:03:01 +0000 (UTC)
From: PerlFAQ Server <comdog@panix.com>
Subject: FAQ 6.4: I put a regular expression into $/ but it didn't work. What's wrong?
Message-Id: <clogrl$glg$1@reader1.panix.com>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with Perl.
--------------------------------------------------------------------
6.4: I put a regular expression into $/ but it didn't work. What's wrong?
Up to Perl 5.8.0, $/ has to be a string. This may change in 5.10, but
don't get your hopes up. Until then, you can use these examples if you
really need to do this.
Use the four argument form of sysread to continually add to a buffer.
After you add to the buffer, you check if you have a complete line
(using your regular expression).
local $_ = "";
while( sysread FH, $_, 8192, length ) {
while( s/^((?s).*?)your_pattern/ ) {
my $record = $1;
# do stuff here.
}
}
You can do the same thing with foreach and a match using the
c flag and the \G anchor, if you do not mind your entire file
being in memory at the end.
local $_ = "";
while( sysread FH, $_, 8192, length ) {
foreach my $record ( m/\G((?s).*?)your_pattern/gc ) {
# do stuff here.
}
substr( $_, 0, pos ) = "" if pos;
}
--------------------------------------------------------------------
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-2002 Tom Christiansen and Nathan
Torkington, and other contributors as noted. All rights
reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
------------------------------
Date: Wed, 27 Oct 2004 17:42:22 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: FAQ 6.4: I put a regular expression into $/ but it didn't work. What's wrong?
Message-Id: <cloisu$9dc$2@sun3.bham.ac.uk>
PerlFAQ Server wrote:
> --------------------------------------------------------------------
>
> 6.4: I put a regular expression into $/ but it didn't work. What's wrong?
>
> Up to Perl 5.8.0, $/ has to be a string. This may change in 5.10, but
> don't get your hopes up. Until then, you can use these examples if you
> really need to do this.
Or, use File::Stream
------------------------------
Date: Wed, 27 Oct 2004 11:27:56 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Finding the size of a rather complicated hash-structure
Message-Id: <cq9452-7e5.ln1@osiris.mauzo.dyndns.org>
Quoth Fred <na@na.no>:
> Hi group
>
> Ok, so I've got a rather complicated hash-structure that I'd like to find
> the size of. Size in consumed bytes of memory. Just because I'm curious.
> And I've done the obligatory searches for finding sizes of stuff, and I'm
> not much the wiser. Exept I've come to understand that there isn't any
> bult-in functionality to do this for such structures.
Devel::Size
> I suppose I could loop through tree, pushing name and file to an array,
> looping through the architectures for each element in tree, and pushing
> name and file to the same array, and doing the same with the components.
> And then just flattening the array and use length(). But...that's kinda
> dirty.....
Also completely wrong. Perl data structures have quite a lot of overhead.
Ben
--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. ben@morrow.me.uk
------------------------------
Date: Wed, 27 Oct 2004 13:16:11 -0400
From: "nntp" <nntp@rogers.com>
Subject: How do I parse this Charactor? 2byte vs 1byte
Message-Id: <WumdnfjO4eFqSuLcRVn-tQ@rogers.com>
I found the bug, and could not fix it. It is related to OS related bytes.
Under dos, it looks like this
valign="top">¨¢</td>
In Unix, it looks like this
valign="top">| </td>
In my Textpad (in Chinese OS), it looks like this
valign="top">?/td>
I asked experts about this. They told me that the charactor is missed
combined with the next charactor to become one charactor.
How do I make sure my perl can parse this correctly? Can perl tell 2 byte
word and 1 byte word?
------------------------------
Date: Wed, 27 Oct 2004 19:37:18 +0200
From: Karel Kubat <karel@e-tunity.com>
Subject: Re: How do I parse this Charactor? 2byte vs 1byte
Message-Id: <417fdccf$0$142$e4fe514c@dreader19.news.xs4all.nl>
Hi,
> I found the bug, and could not fix it. It is related to OS related bytes.
>
> Under dos, it looks like this
> valign="top">¨¢</td>
> In Unix, it looks like this
> valign="top">| </td>
> In my Textpad (in Chinese OS), it looks like this
> valign="top">?/td>
>
> I asked experts about this. They told me that the charactor is missed
> combined with the next charactor to become one charactor.
> How do I make sure my perl can parse this correctly? Can perl tell 2 byte
> word and 1 byte word?
This is not a Perl issue per se, and neither an OS-related issue. You're
dealing with multibyte encodings of characters.
You need to look at the encoding of the original document first. Off the top
of my head, in an XML document, it would say something like <?xml
version="1.0" encoding="....."?>. When the encoding specifier is missing,
then UTF-8 is the default I think.
Your problem however probably refers to an HTML page, not to an XML
document. In that case the encoding might be in one of the HTTP headers
that are sent when a server outputs a page -- that will depend on the
server configuration.
And regarding encodings or character sets: _yes_, Perl can be told to
regard 2-byte sequences as 1 character (or even more than 2 bytes,
actually). Try "perldoc -f multibyte" and then play around with the Unicode
modules.
What _is_ the problem you're describing anyway? It might be helpful to
know..
Cheers,
--
Karel Kubat <karel@e-tunity.com, karel@qbat.org>
Phone: mobile (+31) 6 2956 4861, office (+31) (0)38 46 06 125
PGP fingerprint: D76E 86EC B457 627A 0A87 0B8D DB71 6BCD 1CF2 6CD5
From the Science Exam Papers:
Vegetative propagation is the process by which
one individual manufactures another individual
by accident.
------------------------------
Date: Wed, 27 Oct 2004 13:46:35 -0400
From: Bob Walton <see@sig.invalid>
Subject: Re: How do I parse this Charactor? 2byte vs 1byte
Message-Id: <417fdccd$1_5@127.0.0.1>
nntp wrote:
> I found the bug, and could not fix it. It is related to OS related bytes.
>
> Under dos, it looks like this
> valign="top">¨¢</td>
> In Unix, it looks like this
> valign="top">| </td>
> In my Textpad (in Chinese OS), it looks like this
> valign="top">?/td>
>
> I asked experts about this. They told me that the charactor is missed
> combined with the next charactor to become one charactor.
>
> How do I make sure my perl can parse this correctly? Can perl tell 2 byte
> word and 1 byte word?
>
>
Well, you'll need to:
1. Get a recent version of Perl if you don't already have it (5.8.4 is
fine).
2. Check out the docs for the binmode() function: perldoc -f binmode
3. Determine what sort of encoding is used to represent your character.
If you don't know, you can guess by trying the options available in
the binmode() function. Chances are good it is UTF-8 encoding.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Wed, 27 Oct 2004 14:06:15 +0100
From: Dr John Stockton <spam@merlyn.demon.co.uk>
Subject: Re: How do I parse this page?
Message-Id: <FwU9QDAH15fBFw1M@merlyn.demon.co.uk>
JRS: In article <Xns958EB135B42A7asu1cornelledu@132.236.56.8>, dated
Tue, 26 Oct 2004 21:25:13, seen in news:comp.lang.javascript, A. Sinan
Unur <1usa@llenroc.ude.invalid> posted :
>"nntp" <nntp@rogers.com> wrote in
>news:_dydnarTGPNdFePcRVn-sQ@rogers.com:
>
>> I am trying to parse
>> http://www.ebay.com without success.
>>
>> I view the source, and I see a lot of ?/td>. This page is unsavable.
>
>That ain't true. If you have any questions on parsing HTML using
>HTML::Parser, please post them here. Otherwise, this waaay off-topic.
Please take greater, or at least better, thought before using a word
such as "here".
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.
------------------------------
Date: 27 Oct 2004 09:29:26 -0700
From: hao.luan@gmail.com (Howard)
Subject: how to kill a process initiated by system()
Message-Id: <488b743f.0410270829.384d2ba7@posting.google.com>
Hi All,
I ran into a scenario that I initiate from system(), however, the
process doesn't exit and hang over there. I am just wondering if there
is a way to kill the process after half hour run no matter it is
healthy or not.
Regards,
------------------------------
Date: Wed, 27 Oct 2004 19:14:17 +0200
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: how to kill a process initiated by system()
Message-Id: <417fd767$0$17094$bb690d87@news.main-rheiner.de>
Howard wrote:
> Hi All,
>
> I ran into a scenario that I initiate from system(), however, the
> process doesn't exit and hang over there. I am just wondering if there
> is a way to kill the process after half hour run no matter it is
> healthy or not.
>
> Regards,
perldoc -f alarm
Thomas
--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-
------------------------------
Date: 27 Oct 2004 17:18:45 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to kill a process initiated by system()
Message-Id: <clol9l$b2a$1@mamenchi.zrz.TU-Berlin.DE>
Howard <hao.luan@gmail.com> wrote in comp.lang.perl.misc:
> Hi All,
>
> I ran into a scenario that I initiate from system(), however, the
> process doesn't exit and hang over there. I am just wondering if there
> is a way to kill the process after half hour run no matter it is
> healthy or not.
That will be hard to do, because system() only returns after the external
process has ended. You could set an alarm timer and kill the process
from the signal handler if you knew the pid, but you don't.
You'll be much better off creating the child process yourself, probably
using explicit fork. The parent process knows the pid and can kill
the child process when it runs too long.
Anno
------------------------------
Date: 27 Oct 2004 17:20:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to kill a process initiated by system()
Message-Id: <cloldb$b2a$2@mamenchi.zrz.TU-Berlin.DE>
Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in comp.lang.perl.misc:
> Howard wrote:
>
> > Hi All,
> >
> > I ran into a scenario that I initiate from system(), however, the
> > process doesn't exit and hang over there. I am just wondering if there
> > is a way to kill the process after half hour run no matter it is
> > healthy or not.
> >
> > Regards,
>
> perldoc -f alarm
Fine if you know what pid to kill, but with system() you don't.
Anno
------------------------------
Date: Wed, 27 Oct 2004 19:38:05 +0200
From: Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de>
Subject: Re: how to kill a process initiated by system()
Message-Id: <417fdcfc$0$17094$bb690d87@news.main-rheiner.de>
Anno Siegel wrote:
> Thomas Kratz <ThomasKratz@REMOVEwebCAPS.de> wrote in comp.lang.perl.misc:
>
>>Howard wrote:
>>
>>
>>>Hi All,
>>>
>>>I ran into a scenario that I initiate from system(), however, the
>>>process doesn't exit and hang over there. I am just wondering if there
>>>is a way to kill the process after half hour run no matter it is
>>>healthy or not.
>>>
>>>Regards,
>>
>>perldoc -f alarm
>
>
> Fine if you know what pid to kill, but with system() you don't.
>
> Anno
You're right. Foggy memory, I really should test before posting.
It's time to go home now :-)
Thomas
--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-
------------------------------
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 V10 Issue 7322
***************************************