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

Monks:

I'm just starting to use Perl to help me automate some tasks in ClearCase on AIX. Please forgive me if this is an ignorant question.

My question is:

How can I set the group for the process that is running the script?

I have attempted to use this

system ("newgrp","groupname")

but I discovered from the manpages that this spawns a new shell with the new group (and appears to kill the old one, ending my script unexpectedly!).

Any ideas? Or do you need more information?

Thanks

Replies are listed 'Best First'.
Re: Setting the primary group from within a script
by Zaxo (Archbishop) on Aug 01, 2001 at 01:46 UTC

    setpgrp 0, $pgrp;

    See perldoc perlfunc or any perl reference for details. This is a rather unportable function in its details, but should work for you.

    After Compline,
    Zaxo