if($ a = ~m!Y!i)这在perl / cgi-perl中意味着什么?

时间:2017-06-23 06:58:12

标签: perl cgi

守则是这样的:

   <?php
$res = $this->find('all', $cond); // All the data are fetched from this $res
$count = count($res);
for ($i = 0; $i < $count; $i++) {
    $result[] = $res[$i];
    $data = array(); //temporary array

    $data[$i]['MyData'] = $result[$i]['MyData'];

    $data[$i]['MyData']['my_test'] = $result[$i]['c']['my_test'];


    $data[$i]['MyData']['my_date'] = $result[$i]['a']['my_date'];
}

$result['data'] = $data;

这在Perl中意味着什么?

1 个答案:

答案 0 :(得分:2)

它等同于if ($a =~ /Y/i),这是一个正则表达式,用于测试变量$a是否包含字母Y。最后的i会使测试不区分大小写,因此大写或小写Y将匹配。