Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们可以在 perl 中转储文件句柄号的值吗?
例如,当我写function(STDOUT)它应该给出 o/p 1。
function(STDOUT)
1
我试过了
my $fh = \*STDOUT; print Dumper $fh
它打印$VAR1 = \*::STDOUT
$VAR1 = \*::STDOUT
谢谢,拉维
您可以使用fileno():
fileno()
print fileno($fh);