返回列表 发帖
  1. my ($a, $b, $c) = (split( /[ :]/, "INDEX 00 04:00:65" ))[-3,-2,-1];
  2. $a * $e1 + $b * $e2 + $c * $e3
复制代码
或者用正则捕捉
  1. my ($a, $b, $c) =  ("INDEX 00 04:00:65" =~ /(\d+):(\d+):(\d+)/)
  2. $a * $e1 + $b * $e2 + $c * $e3
复制代码
[url=][/url]

TOP

返回列表