小编int*_*int的帖子

从哈希值生成组合

在perl如果我有一个哈希

my %ranges = (                                                                                      
'--tic' => [ 0, 1, 2 ],                                                                             
'--threads' => [ 8, 16 ],                                                                           
'--level' => [ 10, 20 ]                                                                               
);                                                                     
Run Code Online (Sandbox Code Playgroud)

如何生成所有组合的数组,例如

--level 10 --threads 8 --tic 0                                                                        
--level 10 --threads 8 --tic 1                                                                        
--level 10 --threads 8 --tic 2                                                                        
--level 10 --threads 16 --tic 0                                                                       
--level 10 --threads 16 --tic 1                                                                       
--level 10 --threads 16 --tic 2                                                                       
--level 20 --threads 8 --tic 0                                                                        
--level 20 --threads 8 --tic 1                                                                        
--level 20 --threads 8 --tic 2 …
Run Code Online (Sandbox Code Playgroud)

perl hash

5
推荐指数
1
解决办法
144
查看次数

标签 统计

hash ×1

perl ×1