use strict;
use warnings;
use 5.010;

 
 my ($filename, $name1, $name2, $name3, $name4, $name5, $name6)=@ARGV;
 
open(my $fh, '>>', $filename) or die "Could not open file '$filename' $!";
    
	
	if (defined $name2  eq "") {
   


say $fh "\n$name1 $name1                $name1     01  \n";
close $fh;
    print " > only one point entered correctly\n";
}elsif (defined $name3  eq "") {
 


say $fh "\n$name1 $name1                $name1     01  \n$name2 $name2                $name2     02  \n";
	close $fh;			

    print " > only two point entered correctly\n";
}
 
 elsif (defined $name4  eq "") {
   


say $fh "\n$name1 $name1                $name1     01  \n$name2 $name2                $name2     02  \n$name3 $name3                $name3     03   \n";
close $fh;				

    print " > only three point entered correctly\n";
}
 
 elsif (defined $name5  eq "") {
  


say $fh "\n$name1 $name1                $name1     01  \n$name2 $name2                $name2     02  \n$name3 $name3                $name3     03   \n$name4 $name4                $name4     04   \n";
			
close $fh;	
    print " > only four point entered correctly\n";
}
elsif (defined $name6  eq "") {
  

say $fh "\n$name1 $name1                $name1     01  \n$name2 $name2                $name2     02  \n$name3 $name3                $name3     03   \n$name4 $name4                $name4     04   \n$name5 $name5                $name5     05   \n";
		close $fh;		

    print " > only fimm point entered correctly\n";
} else{
  say $fh "\n$name1 $name1                $name1     01  \n$name2 $name2                $name2     02  \n$name3 $name3                $name3     03   \n$name4 $name4                $name4     04   \n$name5 $name5                $name5     05   \n$name6 $name6                $name6     06   ";
	
		
	close $fh;	
	print " > only sex point entered correctly\n";
	}	
say 'done';
