in reply to Re^5: Defining global variable in a subroutine
in thread Defining global variable in a subroutine

Eliya,

I downloaded and tested your script, and it does exactly as you say.

So I have a production 20,000 line application that does the following:

Parent process

Child process

So that's the high level picture. Now the actual work that goes on is all done by subroutine calls from a child as follows:

So based upon you script this shouldn't work, but it does.

The parent doesn't look at any of the 'our' hashes, only the children and each child logs information that they have used from the global hashes.

Now I'm confused at a different level.

Thank you

"Well done is better than well said." - Benjamin Franklin

  • Comment on Re^6: Defining global variable in a subroutine

Replies are listed 'Best First'.
Re^7: Defining global variable in a subroutine
by choroba (Cardinal) on Feb 23, 2012 at 10:23 UTC
    Where does the parent use any value set in a child?

      choroba ,

      Never. Only children process the global hashes

      "Well done is better than well said." - Benjamin Franklin

        Ok, so where does a child access a piece of the global hash changed by a different child? If each child works only on its own copy of the global hash, Eliya is still right (and he really is).
Re^7: Defining global variable in a subroutine
by zwon (Abbot) on Feb 23, 2012 at 11:35 UTC
    Parent process ... Startup and initialize all "common" hashes (ie %SYS, %Account, ... )

    How does it initialises these hashes? I guess they are tied hashes, perhaps something created with IPC::Shareable.