in reply to a regex to split this...
your split works in a scalar context, so you need:
(undef, $userid) = split "/", ....
Which doesn't match both cases, so you need:
(undef, $userid) = split "/|\\\\", $ENV{REMOTE_USER};
Yes, you need 4 slashes.
Also in your regex you need to escacpe the backslash:
--$username =~ m#(cyc)/|\\(.*)#;
|
|---|