We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
> THe problem with that is, that when perl reads my file
> which was created on windows, it treats the whole file as one line that's odd. most MSDOS/Windows files use CR/LF as the end-of-line marker, but it sounds like your file uses just CR...are you sure it's a DOS file and not a Mac file?
to read MSDOS/Windows text files, you need to set the input record separator to CR/LF rather than newline (actually, this isn't strictly necessary. if you don't do it, you just end up with a CR at the end of each line. chomp will get rid of it)
to read Mac text files, set it to just CR: see the man page for 'perlvar' for more info. In reply to Re^3: Matching string, then getting next line
by cas2006
|
|