In article
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] (Andrew Brosnan) wrote:
> I'm processing a string with embedded newlines. For testing I was
> storing the text in __DATA__ and slurping it into a string. This works
> fine. However when I read in a file, I'm having trouble with the line
> endings. Matching begining/end of logical lines is not working as I
> expect. Regexes like the one below match when using the DATA filehandle,
> but don't when opening other text files on my Mac.
>
> $text =~ s/^Text to match.*$//m;
>
> Is this due to UNIX '\n' vs. Mac '\r' line endings? I assumed the 'm'
> modifier would recognize any line ending.
>
> Oh what to do?
>
> Andrew
hum... is 'end of line' caracter important ?
if not, you can do something like that :
while (<FILE>) {
chomp;
if (/?????/) { ... }
}
yes ? no ?
--
klp