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' $!";
say $fh "\n$name1 \n$name2 \n$name3 \n$name4 \n$name5 \n$name6";
close $fh;
say 'done';