Fork

2005-01-20 Thread Tham, Philip
I was opening a html document using the function my $stream = HTML::TokeParser->new($filename) || die "Couldn't read HTML file $filename: $!"; while ($token=$stream->get_token()){ While processing the tokens I am forking a child processes. At some point in the process the variable $stream

fork?

2002-11-13 Thread chad kellerman
Hey guys, I maybe misunderstanding what a fork can do, so I thought I would write in to verify. Because it doesn't appear to be doing what I want (think it should). I have a script that tars (unix) directories. I want the script to tar directories [a-n] as it is tarrring up [a-n] I

Fork ?

2003-03-19 Thread Jeroen Lodewijks
ts. I actually made this program using modules Mime::Lite and Net::FTP No sweat really. But when I FTP or mail, the program waits, so I want to make it multi process. And there is my problem. I tried fork() but it doesn't do what I want or I got it wrong. (maybe it's not the appropriate th

fork

2001-06-17 Thread Ronald J. Yacketta
Folks, Can someone shed some light on using fork to spawn 2+ simultaneous process? I am reading in allot of logfiles and splitting them into 3 separate arrays. Currently I am forking and doing a exec("egrep", "-c", "Err", @array1); (yes, ugly but it is just the be

FORK

2001-10-19 Thread nafiseh saberi
hi all...do you know about  fork function in perl?and do it have any relation with operatingsystem??? _best regrds.nafiseh  .  saberi.Iran   .   notes    .When you've got a Chautauqua in your head, it's extremely hard not to inf

fork

2002-05-03 Thread walter valenti
Hi, if i've got a script like: for($i=1;$i<=5;$i++){ my $pid=fork; die "$!\n" unless defined($pid); unless($pid){ sleep; } } sleep; The father forks 5 childs that sleeping, and after also the father sleeps. The question is: if i send a 'TERM' at

fork

2007-10-29 Thread Ryan Dillinger
Hello, I have this script here: #!/usr/bin/perluse warnings;use strict; print "PID=$$\n"; my $child = fork();die "Can't fork: $!" unless defined $child; if ($child > 0) { # parent process print "Parent process: PID=$$, child=$child\n";} else

Fork ??

2001-11-30 Thread Randy5235
Pretty new to Perl still so forgive me a bit please. I have searched the web (google is my friend) and searched the groups and found multiple things concerning fork. here is the problem I can't find a page that has the basic syntax for using it. I am writing a small bbs system. I need to be

Fork ssh

2010-06-16 Thread Unknown User
Hi I wrote the following script to fork ssh processes with perl and Parallel::ForkManager: #!/usr/local/bin/perl -w use strict; my @cmd = "@ARGV"; use Parallel::ForkManager; my @nodes; open(NODE,") { chomp; push(@nodes,$_); } my $pm = new Parallel:

fork() question

2005-09-24 Thread Peter Rabbitson
I think I am getting the idea of fork() all wrong. Here is an example: my $pid = fork(); if ($pid) { # should apply to parent only? exit; } sleep 1; print "Test\n"; exit; 'Test' does not print. If I remove the 'sleep 1' - it prints. From what I underst

fork question

2006-07-21 Thread Travis Thornhill
riable to track whether or not I still have processes running? #!/usr/local/bin/perl use strict; use warnings; my $pid; my $children = 0; my @args = ( "arg1", "arg2", "arg3", "arg4", );

Fork() Question

2002-10-31 Thread Jessee Parker
I know when you fork() a process the child is a duplicate of the parent, but does the forked copy have the same priority and time slice assigned to it or is it brand new? Jessee -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Fork Question

2002-11-05 Thread Jessee Parker
Using Perl on a Linux system, is there a way to fork off x amount of copies then make a system wait until those copies are finished before forking off more copies? If so can you show me an example if possible. It would be greatly appreciated! TIA Jessee -- To unsubscribe, e-mail: [EMAIL

RE: fork?

2002-11-13 Thread Daryl J. Hoyt
I think what you want is #!/usr/bin/perl use strict; use warnings; $SIG{CHLD} = sub {wait ()}; #wait to avoid zombies my $pid = fork (); die "cannot fork: $!" unless defined($pid); if ($pid == 0) { #do some perl stuff } elsif($pid < 0) { #do some other perl st

RE: fork?

2002-11-14 Thread chad kellerman
Daryl, I appreciated the help. But the perl code in the elsif statement still doesn't execute until the perl code in the if statement. Any other suggestions? I'd like the two perl codes to execute at the same time. Maybe fork can't do this.. THanks, Chad On Wed, 2

RE: fork?

2002-11-14 Thread Paul
> I appreciated the help. But the perl code in the elsif statement > still doesn't execute until the perl code in the if statement. > Any other suggestions? I'd like the two perl codes to execute at > the same time. > Maybe fork can't do this.. I think yo

RE: fork?

2002-11-14 Thread Bob Showalter
> -Original Message- > From: Paul [mailto:ydbxmhc@;yahoo.com] > Sent: Thursday, November 14, 2002 9:35 AM > To: [EMAIL PROTECTED] > Subject: RE: fork? > > ... > if ($pid=fork()) {# I'm the parent > # ... code > } elsif (0 == $pid) { # I

RE: fork?

2002-11-14 Thread Paul
> Minor point; this won't catch an error from fork(). If fork() fails, > it returns undef, and the test: >(0 == $pid) > Will be true, even if $pid is undef. Damn, that's right -- thanks, Bob. *GOOD* point to make. undef() *always* evaluates to zero in a numeric context

FORK USE ?

2002-12-11 Thread Andre
Hi i want to execute an linux command as atotally separeted from the = father process Is this going to work? Is it wrong? my script. fork ("perl anotherscript.pl"); . my script go on... Thanks

Re: Fork ?

2003-03-19 Thread Paul Johnson
On Wed, Mar 19, 2003 at 08:03:09PM -, Jeroen Lodewijks wrote: > And there is my problem. I tried fork() but it doesn't do what I want > or I got it wrong. (maybe it's not the appropriate thing to use > anyway) > It doesn't do what I want at all. It spawns way t

RE: Fork ?

2003-03-19 Thread Kipp, James
to 10 > processes. > Else it should wait until 1 of the 10 processes finishes. > > Any code examples out there?? > > PS The target machine is a Unix box. If you are spawning procs on a win32 box, the typical fork () examples from the unix side may not work in windows. often get

Re: Fork ?

2003-03-19 Thread Mark G
my $MAX_CHILD=3; $|=1; while( $CHILD_SPAWNED < $CHILD_TO_CREATE ){ print "---\t\t RUNING $CHILD_CREATED\n"; if( $CHILD_CREATED < $MAX_CHILD ){ die "couldnt not spawn: $!" unless defined ( my $PID=fork() ); $CHILD_CREATED++; $CHILD_SPAWNED++; unless(

Re: Fork ?

2003-03-19 Thread david
s for the child processes to die and then start another 5 processes: #!/usr/bin/perl -w use strict; use POSIX; my $child = 0; $SIG{CHLD} = sub { while((my $c=waitpid(-1,&POSIX::WNOHANG)) > 0){$child--} }; sub process_handler{ my $num = shift; my $pid = fork;

fork & wait

2003-08-25 Thread T.S.Ravi Shankar
Dear all : I see these lines in a perl program : $pif = fork; if($pid == 0) { exec("hpxy -s xxx.abc"); }else{ $pid1=wait; } I could understand that the fork is needed here to get into the child process "hpxy" !! What is the need for the "wait" here ??

Re: fork

2001-06-17 Thread Peter Scott
At 05:35 PM 6/17/01 -0400, Ronald J. Yacketta wrote: >Folks, > >Can someone shed some light on using fork to spawn 2+ simultaneous process? >I am reading in allot of logfiles and splitting them into 3 separate arrays. >Currently I am forking and doing a exec("egrep", &qu

RE: fork

2001-06-17 Thread Peter Scott
At 11:10 PM 6/17/01 -0400, Ronald J. Yacketta wrote: >I am a bit lost.. all the references to fork() are in the if/else context. > >so, I would wrap the fork code into a sub and then call that sub passing it >the array each time?? Not necessarily. But it would look neater. >pl

Re: fork

2001-06-18 Thread Jos Boumans
Make your life easy, don't fork... on unix systems, it's ok... on NT it's horrible... it's unreliable, blocking, resource hogging anyway, taht's my 2 bits. enough flaming, now for an answer to your question. if you want to fire off multiple processes, i seriously ad

fork function

2001-10-03 Thread walter valenti
Hi, i've some difficulty on the use of fork function. I know that the fork function make a process child, but the i don't know how write the code. Thanks Walter _ Do You Yahoo!? Get your free @yahoo.com addre

Re: FORK

2001-10-19 Thread RaFaL Pocztarski
nafiseh saberi wrote: > hi all... > do you know about fork function in perl? > and do it have any relation with operating > system??? fork() is a standard Unix system function, but on systems without native fork(), perl can emulate it (however I've never used perl on any non-

RE: FORK

2001-10-19 Thread Kipp, James
any reason why you are sending emails to the list in html ?? -Original Message- From: nafiseh saberi [mailto:[EMAIL PROTECTED]] Sent: Friday, October 19, 2001 9:03 AM To: perl Subject: FORK hi all... do you know about fork function in perl? and do it have any relation with operating

RE: FORK

2001-10-19 Thread Jeff Crawford
Not sure if this is useful. But I ran across this on www.perlmonks.com: http://www.perlmonks.com/index.pl?node_id=1044&next=90, FWIW. -Original Message- From: Kipp, James [mailto:[EMAIL PROTECTED]] Sent: Friday, October 19, 2001 12:14 PM To: 'nafiseh saberi'; perl Sub

Re: fork

2002-05-03 Thread Michael Fowler
On Fri, May 03, 2002 at 05:51:42PM +0200, walter valenti wrote: > for($i=1;$i<=5;$i++){ > my $pid=fork; >die "$!\n" unless defined($pid); >unless($pid){ >sleep; >} > } > sleep; [snip] > if i send a 'TERM' at the father, i wa

Proc::Fork

2004-07-13 Thread Michael Gargiullo
10.100.254.253 When the script is run I see this output: #./fork-control-test.pl 10.100.254.255 10.100.254.252 10.100.255.252 10.100.253.255 10.100.255.254 10.100.255.253 10.100.255.251 10.100.254.254 10.100.254.253 0.0.0.0 # 00:08:0E:E5:C6:AC 00:E0:6F:21:6F:34 00:E0:6F:38:54:06 Can't l

Proc::Fork

2004-07-13 Thread Michael Gargiullo
10.100.254.253 When the script is run I see this output: #./fork-control-test.pl 10.100.254.255 10.100.254.252 10.100.255.252 10.100.253.255 10.100.255.254 10.100.255.253 10.100.255.251 10.100.254.254 10.100.254.253 0.0.0.0 # 00:08:0E:E5:C6:AC 00:E0:6F:21:6F:34 00:E0:6F:38:54:06 Can't l

fork example

2007-09-17 Thread perllearner
I am trying to get my mind around using fork() I have a text file that has solid, liquid, and gas on it all on new lines, how I understand fork() is if I wanted to do a print each statement on each line in the file, fork() could do all at once with parent and child processes. I can get around

Re: fork

2007-10-29 Thread Jeff Pang
On 10/29/07, Ryan Dillinger <[EMAIL PROTECTED]> wrote: > > #!/usr/bin/perluse warnings;use strict; > > print "PID=$$\n"; > my $child = fork();die "Can't fork: $!" unless defined $child; > if ($child > 0) { # parent process print "Par

Re: fork

2007-10-29 Thread Tom Phoenix
On 10/29/07, Ryan Dillinger <[EMAIL PROTECTED]> wrote: > #!/usr/bin/perluse warnings;use strict; > > print "PID=$$\n"; > my $child = fork();die "Can't fork: $!" unless defined $child; > if ($child > 0) { # parent process print "Parent

using fork

2001-06-04 Thread Ulises Vega
Hello everybody, I'm using fork with a simple application, and it looks like if the father process continues executing without waiting his child, the following is the code that i use: my $redirected=1; my $pid

Re: Fork ??

2001-11-30 Thread Maxim Berlin
Hello Randy5235, Friday, November 30, 2001, Randy5235 <[EMAIL PROTECTED]> wrote: R> Pretty new to Perl still so forgive me a bit please. I have searched the web R> (google is my friend) and searched the groups and found multiple things R> concerning fork. here is the problem I ca

Re: Fork ??

2001-11-30 Thread Brett W. McCoy
On Fri, 30 Nov 2001, Randy5235 wrote: > Pretty new to Perl still so forgive me a bit please. I have searched the web > (google is my friend) and searched the groups and found multiple things > concerning fork. here is the problem I can't find a page that has the basic > syntax f

Re: Fork ??

2001-11-30 Thread Randy5235
and searched the groups and found multiple things > > concerning fork. here is the problem I can't find a page that has the basic > > syntax for using it. I am writing a small bbs system. I need to be able to > > do several things at the same time eg. check your password while e

Re: Fork ??

2001-12-01 Thread Michael Fowler
On Fri, Nov 30, 2001 at 02:50:49AM -0600, Randy5235 wrote: > Pretty new to Perl still so forgive me a bit please. I have searched the web > (google is my friend) and searched the groups and found multiple things > concerning fork. > here is the problem I can't find a page t

Fork / Sendmail

2002-02-10 Thread Zhe Hong
t best alternative? I was thinking of something similiar to this. foreach $email (@address_list) { # do some processing here unless (defined($pid = fork()) { die "Cannot fork."; } unless ($pid) { open (MAIL, "|/usr/sbin/sendmail -t"); print

Re: Fork ssh

2010-06-16 Thread Jeff Pang
2010/6/17 Unknown User : > > > This works pretty well, but Since There is More than One Way to DO it, > i wonder if anyone has another version that does not use fork? > Just use the right one for you. Instead of processes, the Threads and Coro may also do that well. Regards. --

Re: Fork ssh

2010-06-16 Thread John W. Krahn
Unknown User wrote: Hi Hello, I wrote the following script to fork ssh processes with perl and Parallel::ForkManager: #!/usr/local/bin/perl -w use strict; my @cmd = "@ARGV"; Why would you use an array to store a single scalar value? Either: my $cmd = "@ARGV";

Re: Fork ssh

2010-06-18 Thread Salvador Fandino
On 06/17/2010 04:34 AM, Unknown User wrote: This works pretty well, but Since There is More than One Way to DO it, i wonder if anyone has another version that does not use fork? There is Net::OpenSSH::Parallel. - Salva -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: Fork ssh

2010-06-18 Thread C.DeRykus
On Jun 16, 7:34 pm, knowsuperunkn...@gmail.com (Unknown User) wrote: > Hi > > I wrote the following script to fork ssh processes with perl and > Parallel::ForkManager: > > #!/usr/local/bin/perl -w > use strict; > > my @cmd = "@ARGV"; > use Parallel::ForkM

Re: Fork ssh

2010-06-18 Thread Kenneth Wolcott
Hi; I've been using IPC::Run3 from CPAN for about six months and it works great! Ken Wolcott

Re: Fork ssh

2010-06-20 Thread C.DeRykus
On Jun 17, 7:51 pm, dery...@gmail.com ("C.DeRykus") wrote: > On Jun 16, 7:34 pm, knowsuperunkn...@gmail.com (Unknown User) wrote: > > > > > Hi > > > I wrote the following script to fork ssh processes with perl and > > Parallel::ForkManager: > > &g

Fork - Process ID

2005-05-09 Thread Paul D. Kraus
always BASIC. I wanted to write a program that would write out the process id and the perl program that spawned it to a file then destroy that file when the program fails. This way I can just look at the "log" and see that program X is what keeps hanging. So I have been experminting wit

Re: fork() question

2005-09-24 Thread Binish A R
Peter Rabbitson wrote: I think I am getting the idea of fork() all wrong. Here is an example: my $pid = fork(); if ($pid) { # should apply to parent only? exit; } sleep 1; print "Test\n"; exit; 'Test' does not print. If I remove the 'sleep 1' - it p

fork + objects + logging

2005-10-11 Thread Tom Allison
fork(): I'm trying to put a perl wrapper around some clunky java code to make it play nicer. The best arrangement I have come up with is to use: open(JVM, "java_app.sh |"); I suppose I could use system() as well, but if I read correctly the STDOUT from the java application w

Fork or Thread?

2006-02-22 Thread Sky Blueshoes
I have a Net::IRC application that uses a Win32::GUI interface. My GUI is lagging and I was wondering what would be better to use and how would I go about it. Should I fork the Net::IRC process (how?) or I've read about Threads (not stable?). Any suggestions, hints, tips, LIN

Re: fork question

2006-07-21 Thread John W. Krahn
Travis Thornhill wrote: > I thought I understood this but maybe I don't. Have you read the perlipc doc: perldoc perlipc It has examples on how to use fork. > When perl forks it creates an exact copy of itself with open files, same > variables, hashes, arrays, etc. > > Bu

RE: fork question

2006-07-22 Thread Venkat Saranathan
No, Remember fork creates a copy of the parent's environment in the child's process, so whenever you change the child's variable, it won't have any effect on the parent's and vice versa. One idea is to increase the child counter in the parent process and decrement in

RE: fork question

2006-07-26 Thread Travis Thornhill
Yes that helped. I was able to sort out the proper way to handle processes. Thanks, Travis. Venkat Saranathan <[EMAIL PROTECTED]> wrote: No, Remember fork creates a copy of the parent's environment in the child's process, so whenever you change the child's variab

fork exitting sub

2002-09-26 Thread chad kellerman
Hi everyone, I am forking and it looks like when my foreach loop is completeed it dies without going to the next if statement: I have: foreach my $usr (@users) { my $UsrPid; unless ($UsrPid = fork) { while fork { do stuff exit

Re: Fork() Question

2002-11-01 Thread Jenda Krynicky
From: "Jessee Parker" <[EMAIL PROTECTED]> > I know when you fork() a process the child is a duplicate of the > parent, but does the forked copy have the same priority and time slice > assigned to it or is it brand new? > > Jessee This is operating system dependant

RE: Fork() Question

2002-11-01 Thread Kipp, James
yes, it inherits just about everything: from man page: The fork() and fork1() functions create a new process. The new process (child process) is an exact copy of the calling process (parent process). The child process inherits the following attributes from the parent process

Re: Fork Question

2002-11-06 Thread John W. Krahn
Jessee Parker wrote: > > Using Perl on a Linux system, is there a way to fork off x amount of copies > then make a system wait until those copies are finished before forking off > more copies? If so can you show me an example if possible. It would be > greatly appreci

RE: FORK USE ?

2002-12-11 Thread Bob Showalter
> -Original Message- > From: Andre [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 10, 2002 9:55 PM > To: [EMAIL PROTECTED] > Subject: FORK USE ? > > > Hi i want to execute an linux command as atotally separeted > from the = > father process > Is

CGI Script Fork

2003-11-21 Thread James Taylor
stead but that didn't work either. Also tried adding & to the end of the command, didn't help. #!/usr/bin/perl use strict; use CGI qw(:cgi-lib :cgi :html2); $SIG{CHLD}='IGNORE'; my $pid=fork(); if($pid) { system "/www/scripts/process_list.pl"; # Run script in

CGI Script Fork

2003-11-22 Thread Robert Brown
If the only real purpose for the fork is so that the message can be displayed, why don't you just display the message in a form, and then go do the long operation single threaded. When the long operation finishes, continue to output to the same page and use some javascript to change the con

RE: fork & wait

2003-08-25 Thread Bob Showalter
T.S.Ravi Shankar wrote: > Dear all : > > I see these lines in a perl program : > > $pif = fork; > if($pid == 0) { > exec("hpxy -s xxx.abc"); > }else{ > $pid1=wait; > } > > I could understand that the fork is needed here to get into the chil

timing a fork

2008-08-19 Thread Raymond Wan
Hi all, I'm trying to fork a process under modperl for a web server, but I've realized that the problem / misunderstanding that I'm having is unrelated to modperl...I get the same problem under Perl. What I want to do is to fork a child process (non-perl program), but also

fork .. regex ... etc..

2001-06-16 Thread Ronald J. Yacketta
, read all the files in and then split the files into 3 - 5 separate lists so I can fork children to parse out the required errors. I am not certain as of yet, how to accomplish the splitting of files and then forking. In the meantime I am thinking of ways to cleanly parse the logfiles counting the

perlTk, using fork

2001-08-29 Thread Thomas_P_Murnane
(invalid resource ID chosen for this connection) Major opcode of failed request: 53 (X_CreatePixmap) Resource id in failed request: 0x14f Serial number of failed request: 25739 Current serial number in output stream: 24474 I think it has something to do with the unless(fork), I&#x

Re: fork function

2001-10-03 Thread Michael Fowler
On Wed, Oct 03, 2001 at 11:19:09AM +0200, walter valenti wrote: > i've some difficulty on the use of fork function. > I know that the fork function make a process child, but the i don't know > how write the code. Have you read perldoc -f fork and perldoc perlipc? What diffic

Re: fork function

2001-10-05 Thread walter valenti
that make the request with LWP or SOCKET } dont' make symoultaneus connections but every only one connection for cicle. Thanks Walter > On Wed, Oct 03, 2001 at 11:19:09AM +0200, walter valenti wrote: > > i've some difficulty on the use of fork function. >

Re: fork function

2001-10-05 Thread Michael Fowler
t; old request is closed > (close the socket) > > I.E > for(;;){ > &http; > } > > sub http{ > #sub that make the request with LWP or SOCKET >} Ok, that's what you want to do, but what have you tried? Have you read the documentation? What about

RE: Proc::Fork

2004-07-13 Thread Bob Showalter
method "writer. via package "IO::Pipe::End" at > ./fork-control-test.pl line 92. > 00:E0:6F:14:AD:A2 > Can't locate object method "writer" via package "IO::Pipe::End" at > ./fork-control-test.pl line 92. > > Error Received: Can't locate

RE: Proc::Fork

2004-07-13 Thread Bob Showalter
strict; use IO::Pipe; use IO::Handle; use Proc::Fork; my $num_children = 3; # no. of children my $control = IO::Pipe->new;# control channel # Spawn off some children my @child; for my $num (1 .. $num_children) { my $data = IO::P

fork/exec/pipe

2004-09-29 Thread Zafer Leylek
Hi I am trying to control to start an octave process where I can write to it read the output back into perl. For example I would like to : 1 - Start octave 2 - Write a=1 b=2. Read output into perl 3 - Write a+b. Read output into perl and so on. Could someone please help me do this. Thanks --

The fork command

2006-12-08 Thread Dukelow, Don
I'm using the fork command for the first time, and can't find one simple expiation of it. I know it's not simple, but every index I look it up in has many references all through the book about it. Is there a web page or white paper someplace that could give me one place

A fork problem

2006-12-13 Thread Dukelow, Don
I got this basic "fork" code right out of the book. It is suppose to wait for both child forks to finish before the parent falls through and excute the code after this "if" statement. But which ever child finishes first the parrent will fall through and finish before all t

Re: fork example

2007-09-17 Thread Tom Phoenix
On 9/17/07, perllearner <[EMAIL PROTECTED]> wrote: > I am trying to get my mind around using fork() > > I have a text file that has solid, liquid, and gas on it all on new > lines, how I understand fork() is if I wanted to do a print each > statement on each line in the file

Re: using fork

2001-06-04 Thread iansmith
On Mon, 4 Jun 2001, Ulises Vega wrote: > I'm using fork with a simple application, and it looks like if the > father process continues executing without waiting his child, the > following is the code that i use: Seems like you want to use the system command instead. syste

RE: using fork

2001-06-04 Thread Peter Cornelius
I see a posting suggesting using system() which does sound like a good solution. If for some reason you need to fork explicitly look at waitpid() I think it will do what you want. Peter C. > -Original Message- > From: Ulises Vega [mailto:[EMAIL PROTECTED]] > Sent: Monday, June

Re: using fork

2001-06-04 Thread Ulises Vega
Thanks for your help. I can't use system because , a nested command in my program is not allowed, so i try the fork. I try with waitpid($pid, ) but i didn't know how to tell the waitpid that waits for the child and don't continue waitpid($pid,&WNOHANG) > conti

RE: using fork

2001-06-04 Thread Peter Cornelius
> I can't use system because , a nested command in my program is not > allowed, so i try the fork. > I try with waitpid($pid, ) but i didn't know how to tell > the waitpid > that waits for the child and don't continue > > waitpid($pid,&WNOHANG)

Fork resetting file descriptors

2005-01-21 Thread Tham, Philip
I was opening a html document using the function my $stream = HTML::TokeParser->new($filename) || die "Couldn't read HTML file $filename: $!"; while ($token=$stream->get_token()){ While processing the tokens I am forking child processes. At some point in the process the variable $stre

db handles with fork()

2005-03-30 Thread Ramprasad A Padmanabhan
Hi, I am writing a perl application that connect to a database and then does a fork() The child completes the process and does a exit(), but the problem is it closes the database connection which the parent would like to use. Can I exit the child process without disconnecting the parent dbi

Fork - Tracking Hung Process

2005-05-09 Thread Paul D. Kraus
am looking at the fork command but I am confused on the output. The program and its output are at bottom of the mail. First please explain why the PID prints twice when I only have one print statement and it is not in a loop. Second let me know if there is a better way to solve my problem. TIA

RE: Fork - Process ID

2005-05-09 Thread Larsen, Errin M HMMA/IT
> -Original Message- > From: Paul D. Kraus [mailto:[EMAIL PROTECTED] > Sent: Monday, May 09, 2005 9:19 AM > To: Perl Beginners List > Subject: Fork - Process ID > > > Sceniro. > I have many cron jobs that run perl scripts. These perl > scripts launc

Re: Fork - Process ID

2005-05-09 Thread mgoland
- Original Message - From: "Paul D. Kraus" <[EMAIL PROTECTED]> Date: Monday, May 9, 2005 10:18 am Subject: Fork - Process ID > Sceniro. > I have many cron jobs that run perl scripts. These perl scripts launch > TbredBasic Applications. The problem I keep findi

Re: Fork - Process ID

2005-05-09 Thread John W. Krahn
[EMAIL PROTECTED] wrote: The reason your code prints pid twice, is in the placement of your print statment. Since you placed your print code after your fork statment, both parent and child read that statment. Inside that block Parent will see pid of ' 0 ' for child, which is normaly a

Re: fork + objects + logging

2005-10-12 Thread Marcello
Tom Allison ha scritto: [snip other question] Logging: I am using a package Log::Dispatch to do my logging. Is there any penalty to loading the same modules for Log::Dispatch into multiple Packages (Main plus all my custom package/modules)? IIRC this should share the memory but allow each

Perl fork or system

2006-03-15 Thread Sonika Sachdeva
. get hold of the output zip file for processing I have 2 options 1. $retval = system("perl sample.pl $filename"); I would need a while loop to poll the "$?" for the complete execution of the system command. 2. if (!defined($kidpid = fork())) { # fork returned undef,

RE: fork exitting sub

2002-09-26 Thread Kipp, James
> foreach my $usr (@users) { > my $UsrPid; > unless ($UsrPid = fork) { > while fork { > do stuff > exit 0; > } > exit 0; >} >waitpid($UsrPid,0); > } > if (def

RE: fork exitting sub

2002-09-26 Thread chad kellerman
before forking another process you should wait a few before forking a new one.. --chad On Thu, 2002-09-26 at 10:17, Kipp, James wrote: > > > foreach my $usr (@users) { > > my $UsrPid; > > unless ($UsrPid = fork) { > > while fork { >

RE: fork exitting sub

2002-09-26 Thread Kipp, James
> > James, > >I an tarring up different directories. Directories that may be in > home or maybe in another location. The directories in home are @users > and the directories in another location are @otherusrs. The thing is > the directories in the other location might not exist. > I

RE: fork exitting sub

2002-09-26 Thread chad kellerman
James, The script is too long. I fork because I tar thru ssh which uses memory. So that server I am on doesn't go done because of memory consumption I fork each tar so when the fork dies the memory is freed for the system.. I really think I have issues with my exit 's.. I a

RE: fork exitting sub

2002-09-26 Thread Kipp, James
ok, you should only need to exit the parent of the fork succeeds, in fact. looks like your second exit is exiting the child prematurely > -Original Message- > From: chad kellerman [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 26, 2002 10:48 AM > To: [EMAIL PROTECTE

Re: fork exitting sub

2002-09-26 Thread david
Chad Kellerman wrote: > I have: > > foreach my $usr (@users) { > my $UsrPid; > unless ($UsrPid = fork) { > while fork { > do stuff > exit 0; > } > exit 0; i don't understa

Re: fork exitting sub

2002-09-26 Thread chad kellerman
(@users) { > > my $UsrPid; > > unless ($UsrPid = fork) { > > while fork { > > do stuff > > exit 0; > > } > > exit 0; > > i don't understand why you need another

Re: fork exitting sub

2002-09-26 Thread david
{ > my $UsrPid; > unless ($UsrPid = fork) { > while fork { > do stuff > exit 0; > } > exit 0; >} >waitpid($UsrPid,0); > } different than: foreach my $user (@user

Re: fork exitting sub

2002-09-26 Thread Michael Fowler
reach my $usr (@users) { > my $UsrPid; > unless ($UsrPid = fork) { > while fork { > do stuff > exit 0; > } > exit 0; >} >waitpid($UsrPid,0); > } > if (defined @otherus

to fork or not?

2002-10-22 Thread chad kellerman
te? I am think I have to fork the tar, but I am not too sure if this would be the best approach. thanks for the help. --chad -- Chad Kellerman Jr. Systems Administrator Alabanza Inc 410-234-3305 signature.asc Description: This is a digitally signed message part

System/Exec/Fork ... Help!

2002-11-18 Thread Jason Frisvold
I'm writing a monitoring system (Yes, still... Finally got the go-ahead to do this) and my design calls for a central "Smart" Daemon that spawns and monitors the lesser Daemons that do the actual monitoring. My problem is that I'm not sure how to go about this. >From

Re: CGI Script Fork

2003-11-22 Thread James Taylor
the window while it's running and thus will have to start the process again. So, the reason for the fork isn't for the message to be displayed, it's so that it starts the system call in the background so we don't have to sit through it. On Nov 21, 2003, at 11:08 PM, Robert

  1   2   3   >