in reply to Re^2: Problems with Perl 5.8.5 and SuSE 92.
in thread Problems with Perl 5.8.5 and SuSE 92.
I think you have a line seperator problem. DOS lines end with CR LF. Unix lines end with LF. If you're reading a DOS text file in unix, the chomp will remove the LF but leave the CR in, causing every line being printed to apear on top of each other. Try $/ = "\x0D\x0A"; before the read, or try adding $genome =~ s/\x0D//g; or try using the following:
#!/usr/bin/perl use warnings; use strict; my $filename = 'T7.fa'; open(DNA, $filename); my $genome; { local $/; $genome = <DNA>; } close DNA; $genome =~ s/\x0D\x0A//g; print "$genome\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Problems with Perl 5.8.5 and SuSE 92.
by Anonymous Monk on Dec 12, 2004 at 02:42 UTC |