[lintian] 03/04: private/generate-profiles: Use autodie instead of manual error checking
This is an automated email from the git hooks/post-receive script.
nthykier pushed a commit to branch master
in repository lintian.
commit 341faf5a0821485f348936906e07543c93405ae8
Author: Niels Thykier <niels@thykier.net>
Date: Sun Jul 19 15:02:03 2015 +0200
private/generate-profiles: Use autodie instead of manual error checking
Signed-off-by: Niels Thykier <niels@thykier.net>
---
private/generate-profiles.pl | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/private/generate-profiles.pl b/private/generate-profiles.pl
index eede1b9..7ed46cc 100755
--- a/private/generate-profiles.pl
+++ b/private/generate-profiles.pl
@@ -5,6 +5,7 @@
use strict;
use warnings;
+use autodie;
use constant LINE_LENGTH => 80;
use constant FIELD_ORDER => (
@@ -72,7 +73,7 @@ exit 0;
sub generate_profile {
my ($profile, $main, @other) = @_;
my $filename = "profiles/$profile.profile";
- open(my $fd, '>', $filename) or die "$filename: $!";
+ open(my $fd, '>', $filename);
print $fd "# This profile is auto-generated\n";
print $fd "Profile: $profile\n";
foreach my $f (FIELD_ORDER) {
@@ -94,7 +95,7 @@ sub generate_profile {
}
print $fd "\n";
}
- close($fd) or die "$filename: $!";
+ close($fd);
return;
}
@@ -120,13 +121,13 @@ sub format_field {
sub read_tags {
my ($file) = @_;
my @tags = ();
- open my $fd, '<', $file or die "$file: $!";
+ open(my $fd, '<', $file);
while (<$fd>) {
strip;
next if /^#/ or $_ eq '';
push @tags, $_;
}
- close $fd;
+ close($fd);
return @tags;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: