在这种情况下,在Perl中做什么?

前端之家收集整理的这篇文章主要介绍了在这种情况下,在Perl中做什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我很困惑第二行在这段代码中做了什么.我认为$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.

猜你在找的Perl相关文章