我很困惑第二行在这段代码中做了什么.我认为$runas应该评估给用户的uid.什么是$<做?这包含在CGI脚本中.
my $runAS = (getpwnam("username"))[2]; $runAS = $< if ($runAS == 0);
解决方法
$<在perl是一个
special variable:
The real uid of this process. You can change both the real uid and the effective uid at the same time by using POSIX::setuid() . Since changes to $< require a system call,check $! after a change attempt to detect any possible errors.