summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Brocard <acme@astray.com>2011-07-18 11:45:26 +0100
committerLeon Brocard <acme@astray.com>2011-07-18 11:45:26 +0100
commit542339496300efe81a15ed97dad3c84e6c358965 (patch)
tree5e8b1ac111f305616bed1092f0f8c513bf929126
parentd7dd272c4d8ca989fc8eadb0adfb9494fc91ee1e (diff)
downloadperl-542339496300efe81a15ed97dad3c84e6c358965.tar.gz
Enable autodie in Porting/corelist.pl
-rwxr-xr-xPorting/corelist.pl11
1 files changed, 6 insertions, 5 deletions
diff --git a/Porting/corelist.pl b/Porting/corelist.pl
index fda9a5e91a..4e18e3701c 100755
--- a/Porting/corelist.pl
+++ b/Porting/corelist.pl
@@ -7,6 +7,7 @@
# With an optional arg specifying the root of a CPAN mirror, outputs the
# %upstream and %bug_tracker hashes too.
+use autodie;
use strict;
use warnings;
use File::Find;
@@ -36,7 +37,7 @@ if ( !-f 'MANIFEST' ) {
die "Must be run from the root of a clean perl tree\n";
}
-open( my $corelist_fh, '<', $corelist_file ) || die "Could not open $corelist_file: $!";
+open( my $corelist_fh, '<', $corelist_file );
my $corelist = join( '', <$corelist_fh> );
if ($cpan) {
@@ -46,11 +47,11 @@ if ($cpan) {
my $fh;
if ( -e $modlistfile ) {
warn "Reading the module list from $modlistfile";
- open $fh, '<', $modlistfile or die "Couldn't open $modlistfile: $!";
+ open $fh, '<', $modlistfile;
} elsif ( -e $modlistfile . ".gz" ) {
my $zcat = can_run('gzcat') || can_run('zcat') or die "Can't find gzcat or zcat";
warn "Reading the module list from $modlistfile.gz";
- open $fh, '-|', "$zcat $modlistfile.gz" or die "Couldn't zcat $modlistfile.gz: $!";
+ open $fh, '-|', "$zcat $modlistfile.gz";
} else {
warn "About to fetch 02packages from ftp.funet.fi. This may take a few minutes\n";
$content = fetch_url('http://ftp.funet.fi/pub/CPAN/modules/02packages.details.txt');
@@ -253,8 +254,8 @@ warn "All done. Please check over $corelist_file carefully before committing. Th
sub write_corelist {
my $content = shift;
- open (my $clfh, ">", $corelist_file) || die "Failed to open $corelist_file for writing: $!";
- print $clfh $content || die "Failed to write the new CoreList.pm: $!";
+ open (my $clfh, ">", $corelist_file);
+ print $clfh $content;
close($clfh);
}