open (FILE, '>', 'sample.txt') or die "Could not open sample.txt: $!"; close (FILE) or die "Could not close sample.txt: $!";