我试图在perl脚本中使用stat()。我阅读了perldocs上的文档,其中说要像这样使用它:
$mode = (stat($filename))[2];但这是行不通的:
$mode = (stat($filename))[2];
print $mode;
Use of uninitialized value $mode in print at ... 我认为还需要另一种语法来访问stat返回的值。数据::dumper返回此结构:
@stat = stat($filename);
print Dumper(@stat);
$VAR1 = bless( [
48,
305368,
33188,
1,
0,
0,
0,
'2011',
1397569653,
1397569653,
1397569653,
4096,
8
], 'File::stat' );https://stackoverflow.com/questions/23086148
复制相似问题