At 19:25 +0200 20/7/06, kurtz le pirate wrote:
hum... is 'end of line' caracter important ?
if not, you can do something like that :
while (FILE) {
chomp;
if (/?/) { ... }
}
yes ? no ?
Not really, because if the file is Mac line endings, then that will
read the entire file in a
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
Peter gave some good examples, so I shortened this to supplement his
suggestions.
I prefer to determine what the end-of-line (eol) character is using
something less slippery than \r and \n. In Perl, \n is the native eol
for the OS that Perl is executing under, so it could any of the \n, \r,
\r\n,
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.
All set with this. Converting the line endings worked fine. Thanks.
Andrew
On 7/20/06 at 7:25 PM, [EMAIL PROTECTED] (kurtz le pirate) wrote:
In article
[EMAIL PROTECTED],
[EMAIL PROTECTED] (Andrew Brosnan) wrote:
I'm processing a string with embedded newlines. For testing I was
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
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
On 7/19/06 at 9:51 PM, [EMAIL PROTECTED] (Robert Hicks) wrote:
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
If you want to adjust the line ends in the files have a look at:
ftp://ftp.macnauchtan.com/Software/LineEnds/FixEndsFolder.sit 52 kB
ftp://ftp.macnauchtan.com/Software/LineEnds/ReadMe_fixends.txt 4 kB
Yeah. It's pretty easy in perl too.
I have on occasion, read the first few hundred