Hi<br>I have been writing a script to pass a directory the remove all the files starting with &quot;+&quot; and put them in a&nbsp; an array @del_files and all the remaining in an array @ctr_file<br>The problem Im having is that where the +FILE 's used to be I get blank lines with &quot;\n&quot;&nbsp; in the @ctr_file, which I don't want .
<br> <br>find sub { push(@tmp ,$File::Find::name, -d &amp;&amp; '/', &quot;\n&quot;) }, $tmp_dir;<br><br>#find all files starting with a plus<br>foreach (@tmp) {<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; $_ =~ s/$tmp_dir\/// ; # remove the path to the input working dir so only 
<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # the files and directories in the working dir are used&nbsp; <br>&nbsp;&nbsp;&nbsp; $_ =~ s/\/$//; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #remove trailing &quot;/&quot;<br>&nbsp;&nbsp;&nbsp; # /^\+\w+/i&nbsp; filter all files starting with &quot;+&quot; <br>&nbsp;&nbsp;&nbsp; if ($_ =~ /^\+\w+/i ){ push(@del_files, $_); $_ = &quot;0&quot;; } # filter and pass files starting with + to @del_files for removale
<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; #print &quot;$_&quot;;<br>&nbsp;&nbsp;&nbsp; if ($_ ne &quot;0&quot;){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; push(@ctr_file , &quot;$_&quot;);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; print &quot;$_&quot;;<br>&nbsp;&nbsp;&nbsp; }<br>}<br clear="all"><br><br>Many thanks for you time<br>Greg<br>