-
Perl Regx
Can anyone helps me with Perl programming about Regx?
In txt file it has
Entry: This entry# 2 has been DELETED
I wrote a string match:
$string =~ m/^This\s.*/ig;
Basicially, I have an if statement that compares that $string with another string...
So if ($another string ne $string) {print something out}
else { don't print}
My match $string seems not working at all... my $another string's string has different text, it keeps saying "Don't print"
-
Re: Perl Regx
-
Re: Perl Regx
What does $string contain prior to the match, and what do you expect it to contain afterwards?
-
Re: Perl Regx
The $string basically matches the words that start with "This" in that text file.... it's just a variable declaration.
-
Re: Perl Regx
I want to see you initial assignment to $string, and I want to see the exact code of what you do with it afterwards. My point is, this line:
Code:
$string =~ m/^This\s.*/ig;
doesn't change the contents of $string, but I think you believe it does.