|
-
Jan 7th, 2006, 04:04 PM
#1
Thread Starter
Frenzied Member
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"
-
Jan 10th, 2006, 11:25 PM
#2
Thread Starter
Frenzied Member
-
Jan 11th, 2006, 05:41 AM
#3
Re: Perl Regx
What does $string contain prior to the match, and what do you expect it to contain afterwards?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jan 11th, 2006, 09:00 PM
#4
Thread Starter
Frenzied Member
Re: Perl Regx
The $string basically matches the words that start with "This" in that text file.... it's just a variable declaration.
-
Jan 12th, 2006, 04:12 AM
#5
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|