http://qs321.pair.com?node_id=750331

manoj_speed has asked for the wisdom of the Perl Monks concerning the following question:

Hi friends

I declared a variable in my program. After that I used fork() method. In the child process I changed the value of the variable that I declared before using fork(). It does not affect the value in parent process. Is there any way to change the value of variable in child process that affects the value in parent process?

Replies are listed 'Best First'.
Re: fork method
by lakshmananindia (Chaplain) on Mar 13, 2009 at 07:12 UTC

    Its good to have a look at Sharing Variables between fork

    You can also try using IPC

    --Lakshmanan G.

    Your Attempt May Fail, But Never Fail To Make An Attempt

      Thanks for the reply.

      2017-09-16 Athanasius changed <pre> to <code> tags, etc.


      -- The wisest mind has something yet to learn.
Re: fork method
by vinoth.ree (Monsignor) on Mar 13, 2009 at 07:07 UTC

    I think you can use the vfork system call.

      Have a look at lakshmananindia's post
      Dear friend,

      This method is not working.