my @settings = @_; open my $default, '>', 'default.cfg' or die $!; for (@settings){ print $default $_, "\n"; } close $default;