我想为我的系统增加FD_SETSIZE宏值.有没有办法增加FD_SETSIZE所以选择不会失败
我正在设置包含文件句柄的哈希引用.
我的输入文件的第四列包含一个标识符字段,我用它来命名文件句柄的目标:
col1 col2 col3 id-0008 col5
col1 col2 col3 id-0002 col5
col1 col2 col3 id-0001 col5
col1 col2 col3 id-0001 col5
col1 col2 col3 id-0007 col5
...
col1 col2 col3 id-0003 col5
Run Code Online (Sandbox Code Playgroud)
我使用GNU核心实用程序来获取标识符列表:
$ cut -f4 myFile | sort | uniq
id-0001
id-0002
...
Run Code Online (Sandbox Code Playgroud)
此列中可以有超过1024个唯一标识符,我需要为每个标识符打开一个文件句柄,并将该句柄放入哈希引用中.
my $fhsRef;
my $fileOfInterest = "/foo/bar/fileOfInterest.txt";
openFileHandles($fileOfInterest);
closeFileHandles();
sub openFileHandles {
my ($fn) = @_;
print STDERR "getting set names... (this may take a few moments)\n";
my $resultStr = `cut -f4 $fn | sort …Run Code Online (Sandbox Code Playgroud)