Skip to content

Commit 214ce0d

Browse files
committed
Enforce strict and warnings in scripts/pod2usage.PL
Fix Dual-Life#3 Also prefer using a 3 args open and avoid bareword filehandle.
1 parent ea8e8f6 commit 214ce0d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

scripts/pod2usage.PL

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ use Cwd;
1616
# This forces PL files to create target in same directory as PL file.
1717
# This is so that make depend always knows where to find PL derivatives.
1818
my $origdir = cwd;
19-
chdir(dirname($0));
20-
my $file = basename($0, '.PL');
19+
chdir( dirname($0) );
20+
my $file = basename( $0, '.PL' );
2121
$file .= '.com' if $^O eq 'VMS';
2222

23-
open OUT, '>', $file or die "Can't create $file: $!";
23+
open my $OUT, '>', $file or die "Can't create $file: $!";
2424

2525
print "Extracting $file (with variable substitutions)\n";
2626

2727
# In this section, perl variables will be expanded during extraction.
2828
# You can use $Config{...} to use Configure variables.
2929

30-
print OUT <<"!GROK!THIS!";
30+
print {$OUT} <<"!GROK!THIS!";
3131
$Config{'startperl'}
3232
eval 'exec perl -S \$0 "\$@"'
3333
if 0;
3434
!GROK!THIS!
3535

3636
# In the following, perl variables are not expanded during extraction.
3737

38-
print OUT <<'!NO!SUBS!';
38+
print {$OUT} <<'!NO!SUBS!';
3939
4040
#############################################################################
4141
# pod2usage -- command to print usage messages from embedded pod docs
@@ -197,7 +197,7 @@ pod2usage(\%usage);
197197
198198
!NO!SUBS!
199199

200-
close OUT or die "Can't close $file: $!";
201-
chmod 0755, $file or die "Can't reset permissions for $file: $!\n";
200+
close($OUT) or die "Can't close $file: $!";
201+
chmod( 0755, $file ) or die "Can't reset permissions for $file: $!\n";
202202
exec("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
203-
chdir $origdir;
203+
chdir($origdir);

0 commit comments

Comments
 (0)