我正在维护一些通过串行无线电读取值并将它们解压缩到 Perl 数据结构中的代码:
# Don't yell at me, I didn't write this
if ($command_string =~
/^.(.)(.).(..)(.)(..)(.)(....)(....)(....)(....)
(..)(..)(.)(.)(.)(.)(..)(..)(..)(..)(..)(..)(.)(.).......
(.)........(.)(.).*/sx) {
$config->{sequence} = hex(unpack('H2', $1));
$config->{radio_id} = hex(unpack('H2', $2));
...
$config->{radio_type} = hex(unpack('H2', $26));
$config->{radio_channel} = hex(unpack('H2', $27));
}
这个笨拙的捕获正则表达式让我想知道:Perl 中编号捕获变量的上限是多少?它一直到$MAXINT
吗?