1
我们可以在perl中转储文件句柄号的值吗?perl中的转储文件句柄号
例如,当我写function(STDOUT)
它应该给出o/p 1
。
我试图
my $fh = \*STDOUT;
print Dumper $fh
它打印$VAR1 = \*::STDOUT
感谢, 拉维
我们可以在perl中转储文件句柄号的值吗?perl中的转储文件句柄号
例如,当我写function(STDOUT)
它应该给出o/p 1
。
我试图
my $fh = \*STDOUT;
print Dumper $fh
它打印$VAR1 = \*::STDOUT
感谢, 拉维
您可以使用fileno()
:
print fileno($fh);