in reply to removing colons

First, there is no need to backslash (escape) the colon. It's not a metacharacter. However, that isn't your problem.

When I try the simple code:

use strict; use warnings; while (<DATA>) { s/://g; print $_; } __DATA__ 9:23:00 02:23:34
I find that colons are indeed removed. So the problem is probably related to how you're handling the file IO.

Unless you're using the -i command line option, you can't edit the file in place. You need to open the original file for input, open a temporary file for output, read the orig, get rid of the colons, write the results to the temp file, and then move the temp file to replace the orig.

That ought to do the trick.

Of course if you're just trying to remove colons from times, and preserve them elsewhere, this solution is too aggressive. But your original question didn't really specify.


Dave


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein