In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/204fc54e940e5b5a12d014e3c3d16c06a0241ce8?hp=dd99222174249c21cd2ee296fab66bf7ab5680b5>
- Log ----------------------------------------------------------------- commit 204fc54e940e5b5a12d014e3c3d16c06a0241ce8 Author: Leon Brocard <a...@astray.com> Date: Thu Jun 23 16:05:06 2011 +0100 Move Porting/bump-perl-version to use autodie ----------------------------------------------------------------------- Summary of changes: Porting/bump-perl-version | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Porting/bump-perl-version b/Porting/bump-perl-version index 62ae47e..2023ff8 100644 --- a/Porting/bump-perl-version +++ b/Porting/bump-perl-version @@ -45,6 +45,7 @@ use strict; use warnings; +use autodie; use Getopt::Std; use ExtUtils::Manifest; @@ -239,7 +240,7 @@ sub do_scan { warn "(skipping $file)\n"; next; } - open my $fh, '<', $file or die "Aborting: can't open $file: $!\n"; + open my $fh, '<', $file; my $header = 0; while (<$fh>) { @@ -308,11 +309,11 @@ sub do_update { my %contents; for my $file (sort keys %changes) { - open my $fh, '<', $file or die "open '$file': $!\n"; + open my $fh, '<', $file; binmode $fh; $contents{$file} = [ <$fh> ]; chomp @{$contents{$file}}; - close $fh or die "close: '$file': $!\n"; + close $fh; my $entries = $changes{$file}; for my $line (keys %$entries) { @@ -339,15 +340,15 @@ sub do_update { for my $file (sort keys %contents) { my $nfile = "$file-new"; - open my $fh, '>', $nfile or die "create '$nfile' failed: $!\n"; + open my $fh, '>', $nfile; binmode $fh; print $fh $_, "\n" for @{$contents{$file}}; - close $fh or die "failed to close $nfile; aborting: $!\n"; + close $fh; - my @stat = stat $file or die "Can't stat $file: $!\n"; + my @stat = stat $file; my $mode = $stat[2]; die "stat $file fgailed to give a mode!\n" unless defined $mode; - chmod $mode & 0777, $nfile or die "chmod $nfile failed; aborting: $!\n"; + chmod $mode & 0777, $nfile; } # and rename them @@ -355,7 +356,7 @@ sub do_update { for my $file (sort keys %contents) { my $nfile = "$file-new"; warn "updating $file ...\n"; - rename $nfile, $file or die "rename $nfile $file: $!\n"; + rename $nfile, $file; } } -- Perl5 Master Repository