选项中的值通常是基于零的索引还是基于一个索引?

sid*_*com 1 api indexing perl

使用"粗体"选项,我可以选择一个应该以粗体显示的元素.我应该对第一个元素(一个)使用'0'或'1'吗?

my_print( [ 'one', 'two', 'three' ], { bold => 1 } );
Run Code Online (Sandbox Code Playgroud)

要么

my_print( [ 'one', 'two', 'three' ], { bold => 0 } );
Run Code Online (Sandbox Code Playgroud)

yst*_*sth 6

规范的答案是这样的:

xkcd 163


Qia*_*iau 5

Perl中的索引从此开始,0我建议你也这样实现它.