N
Nathan Olson
Any reason why the following behaves differently from MacPerl to Unix Perl
(in OS 10.2.8)? (Assume all I want to process is the first file; hence the
@ARGV[0].)
open (THISFILE, @ARGV[0]) || die ("Error opening the file ...");
@contents = <THISFILE>;
close (THISFILE);
In MacPerl, an ordinary text file is parsed into the @contents array with
each paragraph being a element. But in OS X/Unix Perl, the entire contents
of the text file is placed in @contents[0]; in other words, it comes in as a
long string, not as separate elements. Why the difference? Does it have to
do with line-endings? And how can I change this?
Any help will be appreciated.
Nate Olson
(in OS 10.2.8)? (Assume all I want to process is the first file; hence the
@ARGV[0].)
open (THISFILE, @ARGV[0]) || die ("Error opening the file ...");
@contents = <THISFILE>;
close (THISFILE);
In MacPerl, an ordinary text file is parsed into the @contents array with
each paragraph being a element. But in OS X/Unix Perl, the entire contents
of the text file is placed in @contents[0]; in other words, it comes in as a
long string, not as separate elements. Why the difference? Does it have to
do with line-endings? And how can I change this?
Any help will be appreciated.
Nate Olson