http://qs1969.pair.com?node_id=110520


in reply to changing uid/gid in suid cgi script

A note for anyone following along at home.

The poster has left out the fact that the script has

use English;
At the top. See perlvar for more info.

Probably most perl programmers write the above snippet like this (with error checking too):-

$( = $) = $new_gid; die "Failed to changed groupid to $new_gid: $!" if $) != $new_gid || $( != $new_gid; $< = $> = $new_uid; die "Failed to changed userid to $new_uid: $!" if $> != $new_uid || $< != $new_uid;
At least that is how I would write it not being a big fan of use English!