试图用方括号匹配一个字符串。
例如:
my $foo = "debug_bus[0]";
my $bar = "debug_bus[0][12:0] = some_value;";
if ($bar =~ $foo)
{
print "Match\n";
}
else
{
print "No Match\n";
}
Run Code Online (Sandbox Code Playgroud)
我会期望“匹配”,但是我不断收到“不匹配”,这使我相信“ [0]”中的括号可能会引起问题?
perl ×1