in reply to Global variable acts like local variable why?

When the child process starts up, the value of $extflag is 0. The child process therefore inherits a copy of $extflag with the value 0. The copy of $extflag in the child is completely separate to the copy in the parent so changing the copy in the parent after the fork has no effect on the child.

  • Comment on Re: Global variable acts like local variable why?