考虑以下代码:
my @Array = ("Case Number: CV-24-987654",
"Case Title: BIG NATIONAL BANK vs. IMA N DEFAULT, ET AL.",
"Case Designation: FORECLOSURE MARSH. OF LIEN",
"Filing Date: 08/10/2024",
"Judge: WILL RULE",
"Mediator: N/A",
"Next Action: N/A",
"Last Status: INACTIVE",
"Last Status Date: 10/04/2024",
"Prayer Amount: \$115,958.65");
my $index = grep { $Array[$_] eq 'Prayer Amount:%' } 0 .. $#Array;
print "My Index Number Is: $index\n";
我只需要匹配字符串的开头来找到包含短语“Prayer Amount:”的元素位置。我尝试使用通配符 % 但它仍然返回 0。
我怎样才能改进这个代码?