in reply to problem while changing user group

Erm, newgrp creates a new shell environment with the changed group credentials; that's not going to do your parent process much good. You need to look at $) and friends in perlvar if you want to change things for the current process.

Update: Duuur, quite right. You'd have to be privileged to muck with $) which you're not because you're resorting to newgrp. Machinations like this have to be done outside your code itself (either by the running user using newgrp then running your code, by having your code setgid as is mentioned below, or by having a small setuid wrapper use $) on your behalf then running your program).

The cake is a lie.
The cake is a lie.
The cake is a lie.

Replies are listed 'Best First'.
Re^2: problem while changing user group
by betterworld (Curate) on Aug 13, 2008 at 21:17 UTC

    $) is probably not going to help either, because a non-root process is not allowed to acquire additional group privileges.

    Perhaps setgid scripts (if your operating system supports them) can help you.

      $) will provide the group ID But I am not able come back to the parent program after changing group in another sub program. Anyway .....Thanks a lot... :-)