in reply to messing up $line?
If they were separate if statements, then yes (possibly). I don't believe the string is ever altered unless an actual replacement happens.
-Paul