Sorry about the lack of information. The data file itself is ~1000 lines of DNA sequence (e.g. NNNNNNAAACCTAGGAATACGCGT) separated by linebreaks. Again, it's very simple code, which is what makes this so frustrating:
#!/usr/bin/perl
use warnings;
use strict;
my $filename = 'T7.fa';
open(DNA, $filename);
my @lines = <DNA>;
close DNA;
chomp(@lines);
my $genome = join('',@lines);
print "$genome\n";
When I run this, I get no error messages, but $genome only prints out what appears to be a concatenation of the last two lines: roughly
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN.
In lieu of
join, I tried the dot operator like this:
... # <DNA> opened
my $genome = '';
while (<DNA>) {
chomp($_);
$genome.=$_;
}
close(<DNA>);
print "$genome\n";
This too gives no errors and returns a short string of Ns. When I print $genome after each iteration of the
while loop it doesn't seem to be adding to the string, but rather erasing the old string and inserting JUST the current line. As I mentioned before, in Windows, both versions return what I expect...a "paragraph" of ~20000 bases. I DO have the same problem on a SuSE 9.0 installation, which I believe includes 5.8.0, but haven't tried anything earlier. Packages that are obviously Perl-driven all seem to work fine on my machine. Thanks so much!