Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

fork method

by manoj_speed (Prior)
on Mar 13, 2009 at 07:02 UTC ( #750331=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://750331]
Approved by olus
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2021-10-18 03:27 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (72 votes). Check out past polls.