rovf has asked for the wisdom of the Perl Monks concerning the following question:
I thought binmode would do the trick, but the resulting file has still \r\n as line delimiter. What am I doing wrong?use IO::File; ... my $inp=new IO::File $inputfile,'r' or die("$!"); my $content=join "\n",<$csfile>; undef $inp; # close file my $outp=IO::File->new($outputfile,'w') or die("$!"); $outp->binmode; print $outp $content; $outp->close;
Additional Info: (Note: File::Copy is not an option here, because I want later have the possibility to modify something in the data before writing)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can't get rid of \r
by tilly (Archbishop) on Sep 11, 2008 at 16:01 UTC | |
by rovf (Priest) on Sep 12, 2008 at 08:42 UTC | |
|
Re: Can't get rid of \r
by bobf (Monsignor) on Sep 12, 2008 at 03:01 UTC | |
|
Re: Can't get rid of \r
by moritz (Cardinal) on Sep 11, 2008 at 15:46 UTC | |
by rovf (Priest) on Sep 11, 2008 at 15:59 UTC | |
|
Re: Can't get rid of \r
by ikegami (Patriarch) on Sep 11, 2008 at 19:47 UTC | |
by rovf (Priest) on Sep 12, 2008 at 08:46 UTC | |
by rovf (Priest) on Sep 12, 2008 at 09:28 UTC |