in reply to chmod in perl script

Have you looked at chmod? Finding out the numeric values for g+s is likely easiest done by using ls on such a directory and then looking at the numeric value for the permissions. Likely it's 04000 for setting the group-sticky-bit, but I don't know.