remove the first line from my directiry : how can i remove the first line from my list of file , this is my code, 

open my directory
    use strict;
    use warnings;

    use utf8;

    use Encode;

    use Encode::Guess;

    use Devel::Peek;
    my $new_directory = '/home/lenovo/corpus';
    my $directory = '/home/lenovo/corpus';
    open( my $FhResultat, '>:encoding(UTF-8)', $FichierResulat );
    my $dir = '/home/corpus';
    opendir (DIR, $directory) or die $!;
    my @tab;
    while (my $file = readdir(DIR)) {

     next if ($file eq "." or $file eq ".." );
        #print "$file\n";

    my $filename_read = decode('utf8', $file); 
            #print $FichierResulat "$file\n";

    push @tab, "$filename_read";

    }
     closedir(DIR);
open my file
    foreach my $val(@tab){


    utf8::encode($val);

    my $filename = $val;

    open(my $in, '<:utf8', $filename) or die "Unable to open '$filename' for read: $!";

    my $newfile = "$filename.new";

    open(my $out, '>:utf8', $newfile) or die "Unable to open '$newfile' for write: $!";
remove the first line

    my @ins = <$in>; # read the contents into an array
    chomp @ins;
    shift @ins; # remove the first element from the array   

    print $out   @ins;
        close($in);
        close $out;
    `rename $newfile,$filename or die "unable to rename '$newfile' to '$filename': $!";
    }

it seems true but the result is an empty file can some one help me PLZ !!!
