use strict;
use warnings;
use 5.010;

 
 my ($filename, $name1, $pld1, $name2, $pld2, $name3, $pld3, $name4, $pld4, $name5, $pld5, $name6, $pld6)=@ARGV;
 
open(my $fh, '>>', $filename) or die "Could not open file '$filename' $!";

if (defined $name2  eq "") {
   


say $fh "\n 17  $name1 $name1                                                             $pld1";
			
close $fh;	
    print " > only one point entered correctly\n";
}elsif (defined $name3  eq "") {
 


say $fh "\n 17  $name1 $name1                                                             $pld1\n 18  $name2 $name2                                                             $pld2";
	close $fh;			

    print " > only two point entered correctly\n";
}
 
 elsif (defined $name4  eq "") {
   


say $fh "\n 17  $name1 $name1                                                             $pld1\n 18  $name2 $name2                                                             $pld2\n 19  $name3 $name3                                                             $pld3";
close $fh;				

    print " > only three point entered correctly\n";
}
 
 elsif (defined $name5  eq "") {
  


say $fh "\n 17  $name1 $name1                                                             $pld1\n 18  $name2 $name2                                                             $pld2\n 19  $name3 $name3                                                             $pld3\n 20  $name4 $name4                                                             $pld4";
			
close $fh;	
    print " > only four point entered correctly\n";
}
elsif (defined $name6  eq "") {
  

say $fh "\n 17  $name1 $name1                                                             $pld1\n 18  $name2 $name2                                                             $pld2\n 19  $name3 $name3                                                             $pld3\n 20  $name4 $name4                                                             $pld4\n 21  $name5 $name5                                                             $pld5";
		close $fh;		

    print " > only fimm point entered correctly\n";
} else{
   say $fh "\n 17  $name1 $name1                                                             $pld1\n 18  $name2 $name2                                                             $pld2\n 19  $name3 $name3                                                             $pld3\n 20  $name4 $name4                                                             $pld4\n 21  $name5 $name5                                                             $pld5\n 22  $name6 $name6                                                             $pld6";
 		
		
	close $fh;	
	print " > only sex point entered correctly\n";
	}	
say 'done';

    