devilpanther
Programmer
Code:
if ($data =~ /\!/ig)
{
if ($data =~ /\!about/ig)
{
print "1";
}
}
The above code is acting very weird;
The idea is simple, to match if the string $data contains a ! char, if it is, match a command: !about
But when the code is running, the first match is successful, but the second match is not.
The code only acts as I want when I change it to:
Code:
if ($data =~ /\!/ig)
{
[COLOR=red]$data_temp = $data;[/color]
if ([COLOR=red]$data_temp[/color] =~ /\!about/ig)
{
print "1";
}
}
Why is this happening, am I doing something wrong, did I miss some important perl matching rule?
Thank you for your time and help.