in reply to Code Misses a Replacement

I can't speak as to why it might be missing the third to last tab (but it probably isn't, it's probably just spacing it as one space).

But, I would suggest doing a s/\|\|/or/g on your source code (that is, replacing the ||'s with or's) or else you won't know when you have a failure in your open or close functions. (||'s precedence is higher than what you want in these cases)