@@ -66,9 +66,9 @@ sub check {
66
66
my ($fh2 , $gzouta ) = tempfile(' pgs_gzouta_XXXX' );
67
67
close $fh2 ;
68
68
69
- open FOO , " >$gzinta " or die " Couldn't write to temp file" ;
70
- print FOO " 1\n " ; # Just one line
71
- close FOO ;
69
+ open my $fh3 , " >" , $gzinta or die " Couldn't write to temp file" ;
70
+ print $fh3 " 1\n " ; # Just one line
71
+ close $fh3 ;
72
72
73
73
if ($^O =~ / MSWin32/i ) {
74
74
eval {require Win32::Process};
@@ -86,6 +86,8 @@ sub check {
86
86
0,
87
87
32, # NORMAL_PRIORITY_CLASS
88
88
" ." )|| die ErrorReport();
89
+
90
+ sleep 1; # Don't read $gzouta before it's written
89
91
}
90
92
else {
91
93
my $pid = fork ();
@@ -97,9 +99,9 @@ sub check {
97
99
if ( $pid ==0 ) { # assignment
98
100
99
101
# Daughter: try to create a PLplot window with a bogus device, to stimulate a driver listing
100
- open STDOUT ," >$gzouta " ;
101
- open STDERR ," >&STDOUT " ;
102
- open STDIN , " <$gzinta " ;
102
+ open STDOUT ," >" , $gzouta ;
103
+ open STDERR ," >&" , STDOUT ;
104
+ open STDIN , " <" , $gzinta ;
103
105
PDL::Graphics::PLplot-> new(DEV => ' ?' );
104
106
exit (0);
105
107
}
@@ -110,12 +112,10 @@ sub check {
110
112
waitpid ($pid ,0); # Clean up.
111
113
}
112
114
113
- sleep 1 if $^O =~ / MSWin32/i ; # Don't read $gzouta before it's written
114
-
115
115
# Snarf up the file.
116
- open FOO , " <$gzouta " ;
117
- my @lines = <FOO >;
118
- close FOO ;
116
+ open my $fh4 , " <" , $gzouta ;
117
+ my @lines = <$fh4 >;
118
+ close $fh4 ;
119
119
120
120
unlink $gzinta ;
121
121
unlink $gzouta ;
@@ -138,7 +138,6 @@ sub check {
138
138
}
139
139
140
140
$filetypes = {};
141
-
142
141
for my $k (keys %{$guess_filetypes }) {
143
142
VAL:for my $v ( @{$guess_filetypes -> {$k }} ) {
144
143
if ($mod -> {devices }-> {$v }) {
0 commit comments