Perl 什么';逐行读取文件的最快方法是什么?

Perl 什么';逐行读取文件的最快方法是什么?,perl,Perl,在perl中逐行读取文件的最快方法是什么 open(my $fh, '<', 'fit.log') or die; 1. while(<$fh>){ blah, blah, blah } 2. while(defined(my $line = <$filehandle>)){ blah, blah, blah } is #2 the same as #1????? 3. Tie::File 4. Any others? 打开(my$fh,“就速度而言

在perl中逐行读取文件的最快方法是什么

open(my $fh, '<', 'fit.log') or die; 

1. while(<$fh>){
blah, blah, blah
}


2. while(defined(my $line = <$filehandle>)){
blah, blah, blah
}

is #2 the same as #1?????

3. Tie::File

4. Any others?

打开(my$fh,“就速度而言,实际的文件i/o几乎肯定会掩盖您编写周围循环的方式的任何差异。但是基准测试或评测将为您提供真正的答案。

就速度而言,实际的文件i/o几乎肯定会掩盖您编写周围循环的方式的任何差异。但是基准测试或评测ing会给你真正的答案。

你为什么想知道?你为什么想知道?