diff --git a/tools/bug_report.pl b/tools/bug_report.pl
index 48afda729167525386d1538fefa8c1b5e9784d8c..18f180cc7328ff5cd94abfed7a3bd0e80acc1ee6 100755
--- a/tools/bug_report.pl
+++ b/tools/bug_report.pl
@@ -45,7 +45,7 @@ sub do_var($) {
 	$var =~ s/\t//g;
 	return $var;
 }
-open STDERR, ">&SAVEERR"; open STDERR, ">&STDOUT";
+open(STDERR, ">&SAVEERR"); open(STDERR, ">&STDOUT");
 $ENV{'SHELL'}="/bin/bash";
 my $var0 = qq{
 	What is your level of Wine expertise? 1-newbie 2-intermediate 3-advanced
@@ -530,7 +530,7 @@ elsif ($outfile ne "no file" and $dbgoutfile eq "no file") {
 		}
 	}
 	unlink($tmpoutfile);
-	open(OUTFILE, "$outfile");
+	open(OUTFILE, "$outfile") || die "Error: Can't open $outfile: $!\n";
 	while (<OUTFILE>) {
 		$lastlines .= $_;
 	}
@@ -550,7 +550,7 @@ else {
 	system("$wineloc WINEDEBUG=$debugopts $extraops \"$program\"");
 }
 sub generate_outfile() {
-open(OUTFILE,">$outfile");
+open(OUTFILE,">$outfile") || die "Error: Can't open $outfile: $!\n";
 print OUTFILE <<EOM;
 Auto-generated debug report by Wine Quick Debug Report Maker Tool:
 WINE Version:                $winever
diff --git a/tools/make_authors b/tools/make_authors
index 806b207b59bd896378f7416ce903a35315289aad..eeaba02b5683e5714c0fb2d2844e5e413c7ad6bf 100755
--- a/tools/make_authors
+++ b/tools/make_authors
@@ -22,7 +22,7 @@ use strict;
 
 my @authors;
 open(AUTHORS,"<AUTHORS") or die "Can't open AUTHORS";
-open(NEWAUTHORS,">AUTHORS.new");
+open(NEWAUTHORS,">AUTHORS.new") or die "Can't open AUTHORS.new";
 while(<AUTHORS>)
   {
     print NEWAUTHORS;
diff --git a/tools/winapi/config.pm b/tools/winapi/config.pm
index 58636df81caaad1cade0a35ac88a51d12c543f6b..b652e490534d73f6618e2c84ef3707a79e4652e7 100644
--- a/tools/winapi/config.pm
+++ b/tools/winapi/config.pm
@@ -155,7 +155,7 @@ sub _get_files($$;$) {
 
     my @dirs = ($dir);
     while(defined(my $dir = shift @dirs)) {
-	opendir(DIR, $dir);
+	opendir(DIR, $dir) || die "Can't open directory $dir: $!\n";
 	my @entries= readdir(DIR);
 	closedir(DIR);
 	foreach (@entries) {
diff --git a/tools/winapi/make_filter b/tools/winapi/make_filter
index e427f8db209a12130e5dc78945237fd84c108600..45665debcf416a16a26d30e86caa7bc179c0e5e5 100755
--- a/tools/winapi/make_filter
+++ b/tools/winapi/make_filter
@@ -44,7 +44,7 @@ if($options->progress) {
 ########################################################################
 
 my $command = $options->make . " " . join(" ", $options->arguments);
-open(IN, "($command) 2>&1 |");
+open(IN, "($command) 2>&1 |") || die "Cannot execute command $command: $!";
 
 while(<IN>) {
     chomp;
diff --git a/tools/winapi/msvcmaker b/tools/winapi/msvcmaker
index 53c37fbc026c541f1c1655f20c61ab5f63a4b826..31bdc93eac11444f211cfe35594d93b4f2cd28b4 100755
--- a/tools/winapi/msvcmaker
+++ b/tools/winapi/msvcmaker
@@ -45,7 +45,7 @@ sub read_spec_file($) {
 
     my $type = "win32";
 
-    open(IN, "< $wine_dir/$spec_file");
+    open(IN, "< $wine_dir/$spec_file") || die "Error: Can't open $wine_dir/$spec_file: $!\n";
 
     my $header = 1;
     my $lookahead = 0;
@@ -115,7 +115,7 @@ sub filter_files($$) {
 my %wine_test_dsp_files;
 
 MAKEFILE_IN: foreach my $makefile_in_file (@makefile_in_files) {
-    open(IN, "< $wine_dir/$makefile_in_file");
+    open(IN, "< $wine_dir/$makefile_in_file") || die "Error: Can't open $wine_dir/$makefile_in_file: $!\n";
 
     my $topobjdir;
     my $module;
diff --git a/tools/winapi/nativeapi.pm b/tools/winapi/nativeapi.pm
index 9f6a35409c3743ef5d076150751745d5e8edee70..78b6ec958fadc97e45ed47ca8c1f5ad20254325c 100644
--- a/tools/winapi/nativeapi.pm
+++ b/tools/winapi/nativeapi.pm
@@ -59,7 +59,7 @@ sub new($) {
 
     $output->progress("$api_file");
 
-    open(IN, "< $api_file");
+    open(IN, "< $api_file") || die "Error: Can't open $api_file: $!\n";
     local $/ = "\n";
     while(<IN>) {
 	s/^\s*(.*?)\s*$/$1/; # remove whitespace at begin and end of line
@@ -73,7 +73,7 @@ sub new($) {
     $output->progress("$configure_ac_file");
 
     my $again = 0;
-    open(IN, "< $configure_ac_file");
+    open(IN, "< $configure_ac_file") || die "Error: Can't open $configure_ac_file: $!\n";
     local $/ = "\n";
     while($again || (defined($_ = <IN>))) {
 	$again = 0;
@@ -141,7 +141,7 @@ sub new($) {
 
     $output->progress("$config_h_in_file");
 
-    open(IN, "< $config_h_in_file");
+    open(IN, "< $config_h_in_file") || die "Error: Can't open $config_h_in_file: $!\n";
     local $/ = "\n";
     while(<IN>) {
 	# remove leading and trailing whitespace
diff --git a/tools/winapi/winapi_check b/tools/winapi/winapi_check
index 89534d1d2456394eb574ff6680a1423180af4b88..61a06351f87b7171ada810470c048b555a0a3886 100755
--- a/tools/winapi/winapi_check
+++ b/tools/winapi/winapi_check
@@ -82,7 +82,7 @@ if ($options->global) {
 
 	$include2info{$file} = { name => $file };
 
-	open(IN, "< $wine_dir/$file");
+	open(IN, "< $wine_dir/$file") || die "Error: Can't open $wine_dir/$file: $!\n";
 	while(<IN>) {
 	    if(/^\s*\#\s*include\s*\"(.*?)\"/) {
 		my $header = $1;
diff --git a/tools/winapi/winapi_extract b/tools/winapi/winapi_extract
index a11a91b1a62ce945255687d065ebefbd6bfe2bff..7c4a394baa2fb52f49dce64abebb110a3a206d9e 100755
--- a/tools/winapi/winapi_extract
+++ b/tools/winapi/winapi_extract
@@ -63,7 +63,7 @@ if($options->spec_files || $options->winetest) {
 
 	my $type = "win32";
 
-	open(IN, "< $wine_dir/$spec_file");
+	open(IN, "< $wine_dir/$spec_file") || die "Error: Can't open $wine_dir/$spec_file: $!\n";
 
 	my $header = 1;
 	my $lookahead = 0;
@@ -210,7 +210,7 @@ foreach my $file (@h_files, @c_files) {
     $progress_current++;
 
     {
-	open(IN, "< $file");
+	open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
@@ -463,7 +463,7 @@ if($options->spec_files) {
 	    $spec_file .= "2";
 
 	    $output->progress("$spec_file");
-	    open(OUT, "> $wine_dir/$spec_file");
+	    open(OUT, "> $wine_dir/$spec_file") || die "Error: Can't open $wine_dir/$spec_file: $!\n";
 
 	    if(exists($specifications{$module}{init})) {
 		my $function = $specifications{$module}{init}{function};
@@ -666,7 +666,7 @@ if($options->winetest) {
 	    next if $external_name eq "\@";
 
 	    if($n == 0) {
-                open(OUT, "> $wine_dir/programs/winetest/include/${package}.pm");
+                open(OUT, "> $wine_dir/programs/winetest/include/${package}.pm") || die "Error: Can't open $wine_dir/programs/winetest/include/${package}.pm: $!\n";
 
                 print OUT "package ${package};\n";
                 print OUT "\n";
diff --git a/tools/winapi/winapi_fixup b/tools/winapi/winapi_fixup
index 235472320615eac64b1e6720b35001cd432d7553..334aa52a5d90215dc68a7931f58630bb35d922b9 100755
--- a/tools/winapi/winapi_fixup
+++ b/tools/winapi/winapi_fixup
@@ -61,7 +61,7 @@ foreach my $file (@c_files) {
     $output->prefix("$file:");
 
     {
-	open(IN, "< $file");
+	open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
diff --git a/tools/winapi/winapi_module_user.pm b/tools/winapi/winapi_module_user.pm
index 09800858e88182ce7feb7ea9d3db17393f6d4789..ef14453061f4426ee7abd37cd6356819ac5494fb 100644
--- a/tools/winapi/winapi_module_user.pm
+++ b/tools/winapi/winapi_module_user.pm
@@ -626,7 +626,7 @@ sub _parse_file($$$) {
     my $found_comment = shift;
 
     {
-	open(IN, "< $file");
+	open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
diff --git a/tools/winapi/winapi_test b/tools/winapi/winapi_test
index 3e4b97eb19f462f7418c351a61cc0143e25adbdc..db95c36df86fa1292092d2f6a436a0b1d7bb7ebf 100755
--- a/tools/winapi/winapi_test
+++ b/tools/winapi/winapi_test
@@ -81,7 +81,7 @@ if (0) {
 
     $file .= "2"; # FIXME: For tests
 
-    open(OUT, "> $winapi_dir/$file") || die "$winapi_dir/$file: $!\n";
+    open(OUT, "> $winapi_dir/$file") || die "Error: Can't open $winapi_dir/$file: $!\n";
 
     my $x = 0;
     my @test_dirs = $tests->get_test_dirs();
@@ -337,7 +337,7 @@ foreach my $file (@files) {
     $progress_current++;
 
     {
-	open(IN, "< $wine_dir/$file");
+	open(IN, "< $wine_dir/$file") || die "Error: Can't open $wine_dir/$file: $!\n";
 	local $/ = undef;
 	$_ = <IN>;
 	close(IN);
diff --git a/tools/winedump/function_grep.pl b/tools/winedump/function_grep.pl
index 5a345266a3019a66a1230f8e66c935cca07db49a..60e5677e2cc0e2abc52a2b71893be2bc1c83acd0 100755
--- a/tools/winedump/function_grep.pl
+++ b/tools/winedump/function_grep.pl
@@ -54,7 +54,7 @@ if (defined $usage)
 }
 
 foreach my $file (@files) {
-    open(IN, "< $file");
+    open(IN, "< $file") || die "Error: Can't open $file: $!\n";
 
     my $level = 0;
     my $extern_c = 0;