Kevin Horton schreef:
At 11:08 -0800 6/3/05, John W. Krahn wrote:

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?

Indeed I do, but it doesn't work without the /g! See below.

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.

That must be the problem! I work on WinXP (for the moment). The file is generated by ChatZilla, the IRC chat program part of the Mozilla suite. I don't know what kind of line endings it uses, how can I see this?


Cheers, H.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to