Hi<br>I have been writing a script to pass a directory the remove all the files starting with "+" and put them in a 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 "\n" in the @ctr_file, which I don't want .
<br> <br>find sub { push(@tmp ,$File::Find::name, -d && '/', "\n") }, $tmp_dir;<br><br>#find all files starting with a plus<br>foreach (@tmp) {<br> <br> $_ =~ s/$tmp_dir\/// ; # remove the path to the input working dir so only
<br> # the files and directories in the working dir are used <br> $_ =~ s/\/$//; #remove trailing "/"<br> # /^\+\w+/i filter all files starting with "+" <br> if ($_ =~ /^\+\w+/i ){ push(@del_files, $_); $_ = "0"; } # filter and pass files starting with + to @del_files for removale
<br> <br> #print "$_";<br> if ($_ ne "0"){<br> push(@ctr_file , "$_");<br> print "$_";<br> }<br>}<br clear="all"><br><br>Many thanks for you time<br>Greg<br>