Hendrik Maryns wrote:Hi,
Hello,
I'm writing a little script for removing "rustle" from a log file from chat channels, in order to do linguistic research on them. I took the file and tied it with Tie::File, in order to easily acces it. This probably isn't all necessary here, but I want to modify the file itself, not writing the output to a new one.
The first thing is stripping of a date and time at the beginning of each line. My re seems to be correct, as it works. I do not understand why I need the /g modifier though. If I remove it, only the first line that matches gets stripped. I thought the substitution was started all over again for every line?
It should work without the /g modifier. Using /g means that you want to match the pattern one or more times on the same string and I assume that you only want to match it once?
What kind of line endings does the file have? If I recall correctly, I ran into a problem where perl did not recognize classical Macintosh line endings as ending a line. It thought the whole file was one line, until I converted the line endings to Unix format.
Kevin Horton
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>