At 11:22 AM -0600 12/9/00, Dan Baker wrote: >Floyd Resler wrote: >> >> I need to read a UNIX file in MacPerl. I know I can read the file as >> one variable. What I don't know how to do is break the text up into >> individual lines based on the UNIX line break. Can anyone help? >> >------------------- >I havent used MacPerl yet, but you *should* be able to: >@Lines = split('\n',$LongString) ; > >the whole purpose of the perl \n is to take care of system dependant >interpretations of CR, LF, etc In Perl \n is the local system's linebreak, whatever it is. On Unix \n == \012, and under Mac OS \n == \015. This choice for \n makes scripts more portable, so that they'll do the "right thing" on any platform. But there are time when you need to be explicit, and this is one of them. If you do the above split on a Unix file using MacPerl, nothing will split. Personally, I'd read a Unix file into an array with MacPerl like this: $/ = '\012'; chomp(@lines = <FILEHANDLE>); >D > ># ===== Want to unsubscribe from this list? ># ===== Send mail with body "unsubscribe" to macperl-request@macperl.org -- -- Paul Schinder schinder@pobox.com # ===== Want to unsubscribe from this list? # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org