in reply to Re^2: [Class Assignment] Regex and Output Files
in thread [Class Assignment] Regex and Output Files

I used your most recent code with this input.txt file:

Out with the old, in with the new. Old stuff is cool. New stuff is also cool. Now to mess with your head: Fortune favors the bold. I knew it.

It produced the following output.txt file:

Out with the old, in with the old. Old stuff is cool. old stuff is also cool. Now to mess with your head: Fortune favors the bold. I kold it.

Do you see the problem(s) yet?

Hint:It is a useful skill to be able to fabricate good test data.

Replies are listed 'Best First'.
Re^4: [Class Assignment] Regex and Output Files
by Hayest (Acolyte) on Feb 20, 2015 at 21:36 UTC
    I do see the problem, I adjusted my regex to fix this =~ s/\bnew\b/old/ig;. I was having problems with the output before, It's working fine now. Thank you for bringing this to my attention!

      You bet -- and congratulations!

      Also, thank you for having the courtesy to point out this was a class assignment. I have no doubts your integrity will serve you well in your life.