forking doubt

2006-03-14 Thread Saurabh Singhvi
Hi all, my $child = fork (); unless ($child) { sleep 5; print "child\n"; } print "parent\n" if $child; print "parent2\n" if $child; the above code prints the parent lines followed by the child. Now what i want to do is print the parent line1 and then the child fol

Re: forking doubt

2006-03-14 Thread Paul Johnson
On Tue, Mar 14, 2006 at 08:57:03AM +, Saurabh Singhvi wrote: >my $child = fork (); > >unless ($child) { >sleep 5; >print "child\n"; >} > >print "parent\n" if $child; >print "parent2\n" if $child; > > > the above code prints the parent lines followed by t

Re: forking doubt

2006-03-14 Thread Jeff Pang
It's not so easy to do that. you should use the signal to communicate between childs and parent. -Original Message- >From: Saurabh Singhvi <[EMAIL PROTECTED]> >Sent: Mar 14, 2006 3:57 AM >To: Perl FAq >Subject: forking doubt > >Hi all, > > > my $child = fork (); > > unless ($child) {

Problem getting a value from a sub-routine

2006-03-14 Thread Mike Martin
Hi I have the following script (copied fairlay verbatim from gtk2-perl tutorial) and I cant seem to get the value out of the show_chooser sub-routine. It prints to the shell but doesnt seem to want to go any where else. I must be missing something simple. Any help appreciated #!/usr/bin/perl use

Line Swap

2006-03-14 Thread sharmila
Hi, I am trying out to swap/move lines of text in perl. Is this is possible? If so, please help me out on how to swap the lines. Input: $dc:[dot 1980] $su:UNITED STATES Output: $su:UNITED STATES $dc:[dot 1980] Thanks and regards, Sharmila Confidentiality Notice: This transmittal is a co

Re: Line Swap

2006-03-14 Thread Jeff Pang
> >Input: > >$dc:[dot 1980] >$su:UNITED STATES > >Output: > >$su:UNITED STATES >$dc:[dot 1980] > You could read these input lines into an array,then call 'reverse' to do that for you. See 'perldoc -f reverse' please. Also give an example here: $ perl -e '@arr=qw/aa bb/;print join " ",reverse @a

Re: First-time forking

2006-03-14 Thread Cornelis Swanepoel
Thanks a lot for your replies, I've incorporated the children counter variable, increasing it after every fork, decreasing it after every SIG{CHLD}. However, I still have an unresolved issue, Jay: > It's not missing; it was never there. Your parent process dies before > its children are finished

WebServices + XML doublt

2006-03-14 Thread I BioKid
dear all, we have a web server that gives out put of 2 tables and 2 images. now, we want to provide a webservice for this server - with 4 services, for example getfoo_table2 getfoo_table1 getfoo_img1 getfoo_img2 i have to start from the scratch - my doubts - to create a web services, whther we n

Re: First-time forking

2006-03-14 Thread Jeff Pang
> >Does that not mean that a parent will stay alive until all children have >finished ? > No,the parent should get exited when it finish its session,in spite of childs are still running or not. When the parent exit,the childs should be take-overed by system init process,whose process ID is typi

Re: First-time forking

2006-03-14 Thread Cornelis Swanepoel
Thanks Jeff, That clarifies it. Regards Cornelis --memento mori On 3/14/06, Jeff Pang <[EMAIL PROTECTED]> wrote: > > > > > >Does that not mean that a parent will stay alive until all children have > >finished ? > > > > No,the parent should get exited when it finish its session,in spite of > chi

Re: First-time forking

2006-03-14 Thread Jeff Pang
>> The process's pid is 1 really.It has been take-overed by system init >> process. >> Sorry for my mistake,it should be "the process's ppid" really.ppid just mean 'parent process id'. -- Jeff Pang NetEase AntiSpam Team http://corp.netease.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Flushing output

2006-03-14 Thread Jeff Pang
>select FH; >$| = 1; >select STDOUT; There is not any problem here.While I find a more simple statement insteadly: select ( (select FH, $|=1)[0] ); It based on the fact that 'select' should return the previous file-handle relative to the selected file-handle. -- Jeff Pang NetEase AntiSpam Te

suggestion for sftp process

2006-03-14 Thread Curt Shaffer
I am writing a process that will need to establish a SFTP connection with a remote server, pull a file down and copy it to an archive and system folder. I also have to do the opposite where I will need to get a file from a system directory and push it via SFTP to a remote server. Now I have the pus

FW: suggestion for sftp process

2006-03-14 Thread Curt Shaffer
I have a small update to this post. I found out that I will be able to get all of the files in the remote directory. Unfortunately I do not see a way to do this with Net::SFTP. There is no mget function and * does not seem to work for the file name. Thanks Curt _ From: Curt Sha

Re: FW: suggestion for sftp process

2006-03-14 Thread Chas Owens
On 3/14/06, Curt Shaffer <[EMAIL PROTECTED]> wrote: > I have a small update to this post. I found out that I will be able to get > all of the files in the remote directory. Unfortunately I do not see a way > to do this with Net::SFTP. There is no mget function and * does not seem to > work for the

Re: Flushing output

2006-03-14 Thread nishanth ev
Put one line at the starting $|=1; Actually it can be any value other than 0. Regards Nishanth --- Chas Owens <[EMAIL PROTECTED]> wrote: > On 3/13/06, Tommy Grav <[EMAIL PROTECTED]> wrote: > > I am writing some output to a file using printf. > However this output > > is buffered. > > How do I g

RE: FW: suggestion for sftp process

2006-03-14 Thread Curt Shaffer
-Original Message- From: KyLiE [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 10:36 AM To: Curt Shaffer Subject: Re: FW: suggestion for sftp process Curt Shaffer wrote: >I have a small update to this post. I found out that I will be able to get >all of the files in the remote d

cpan module installation using Activestate perl package manager

2006-03-14 Thread Sonika Sachdeva
Hi, How do i install FILE::TAIL using activestate perl doing a search using perl package manager doesnt show File::Tail module in its repository thanks,

Re: cpan module installation using Activestate perl package manager

2006-03-14 Thread Chas Owens
On 3/14/06, Sonika Sachdeva <[EMAIL PROTECTED]> wrote: > Hi, > > How do i install FILE::TAIL using activestate perl > doing a search using perl package manager doesnt show File::Tail module in > its repository > > thanks, It looks like ActiveState does not have this module prepackaged. If you pay

RE: cpan module installation using Activestate perl package manager

2006-03-14 Thread Paul Ohashi
perl -MCPAN -e "install FILE::TAIL" -Original Message- From: Sonika Sachdeva [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 11:06 AM To: beginners@perl.org Subject: cpan module installation using Activestate perl package manager Hi, How do i install FILE::TAIL using activestat

Re: cpan module installation using Activestate perl package manager

2006-03-14 Thread Sonika Sachdeva
Hi, I installed File::Tail using nmake. Now when I run my perl script I get the following error for File::stat which was running successfully before. Subroutine import redefined at c:/Perl/lib/File/stat.pm line 25. Subroutine populate redefined at c:/Perl/lib/File/stat.pm line 35. Subroutine lstat

Re: Out of memory! - from CPAN

2006-03-14 Thread Jerry K
Hello, I asked this question, and other than one response (thanks Owen!), things have been pretty silent on this issue. As I am a recent subscriber, maybe this is not the place to post this type of a request. Is there a better place that someone might aim me to resolve this issue? Thanks f

Re: Out of memory! - from CPAN

2006-03-14 Thread Owen Cook
On Tue, 14 Mar 2006, Jerry K wrote: > Hello, > > I asked this question, and other than one response (thanks Owen!), > things have been pretty silent on this issue. > > As I am a recent subscriber, maybe this is not the place to post this > type of a request. > > Is there a better place that

Re: Out of memory! - from CPAN

2006-03-14 Thread John W. Krahn
Owen Cook wrote: > > You could try comp.lang.misc.perl That should be comp.lang.perl.misc :-) John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]