Perl:$ hashName {“ a”,“ b”,“ c”} =“ d”;是什么意思?

Ben*_*uss 5 syntax perl

我正在尝试将大型Perl程序转换为Java。在初始化函数中,它使用括号创建哈希,然后开始分配值。但是随后,这些密钥变成了一对和三组,以逗号分隔的字符串。这是什么意思?

 %par=( ...  )

 $par{"symbolChainAny"}=     "*";   # chain name if ...
 $par{"acc2Thresh"}=         16;    # threshold for...
 $par{"txt","copyright"}=       "elided";
 $par{"txt","contactEmail"}=    "elided";

 $par{"txt","modepred","sec"}=  "prediction of secondary structure";
 $par{"txt","modepred","cap"}=  "prediction of secondary structure caps";```

Run Code Online (Sandbox Code Playgroud)

ike*_*ami 9

$foo{$x, $y, $z}
Run Code Online (Sandbox Code Playgroud)

相当于

$foo{join($;, $x, $y, $z)}
Run Code Online (Sandbox Code Playgroud)

其中$;默认为控制字符("\x1C")。


不只是相似...

$ diff \
   <( perl -MO=Concise,-exec -e'$foo{$x,$y,$z}' 2>&1 ) \
   <( perl -MO=Concise,-exec -e'$foo{join($;,$x,$y,$z)}' 2>&1 ) \
   && echo identical
identical
Run Code Online (Sandbox Code Playgroud)