in reply to removing colons
When I try the simple code:
I find that colons are indeed removed. So the problem is probably related to how you're handling the file IO.use strict; use warnings; while (<DATA>) { s/://g; print $_; } __DATA__ 9:23:00 02:23:34
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
|
|---|