Perl to remove new lines from input file and write to output file
<p>My input is a file with a series of strings, something like this:<br>
ABCDEFGHIJKL<br>
XKGKASKGKD<br>
SGJKSKGS </p>

<p>I want to remove the new lines and write the output to a new file: ABCDEFGHIJKLXKGKASKGKDSGJKSKGS</p>

<p>So far I have this:</p>

<pre><code>#! /usr/bin/perl
use strict;
use warnings;
my $input = $ARGV[0];
my $output = "concatenated.txt"; #Output sequence
#Open output file
open &gt;"$output"; or die "unable to open $output";
#Open input file
open "&lt;$input" or die "unable to open $input";

while (&lt;INPUT&gt;) {
   if( /^[AGCT]/)
   chomp;

print $output;
}

close $input;

close $output;


print "Done!\n";
</code></pre>

<p>But it doesn't work yet.<br>
Is chomp enough to concatenate in this instance?<br>
How do I write what I have created to the output file?</p>