my $fh = IO::File->new(">$filename"); print $fh "Hello\n"; close($fh) or die "Can't close\n";