# 3) Create a chapter file for each destination video file
# tmp chapter file used by handbrake when creating mkv, but remove the 0 byte file it creates, we'll create it if we need it
-my $chapter_file = `tempfile`; chomp($chapter_file); unlink "$chapter_file";
+my $chapter_file = `mktemp`; chomp($chapter_file); unlink "$chapter_file";
foreach my $key (keys %merge_videos) {
# Create the chapters file for each output mkv file.