summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2013-01-12 16:17:03 +0100
committerGuillem Jover <guillem@debian.org>2013-12-04 07:09:42 +0100
commit4b35d5045ad062a8ac61250df685f8b3178e8e9e (patch)
tree4d38cf54c72c09f542fd7266efd5f3a355a0fd60
parentbd281a3259a499217326ad4b3b1a2973a83d7434 (diff)
downloaddpkg-4b35d5045ad062a8ac61250df685f8b3178e8e9e.tar.gz
perl: Use croak instead of die on programming errors in modules
Addresses ErrorHandling::RequireCarping. Warned-by: perlcritic
-rw-r--r--dselect/methods/Dselect/Ftp.pm3
-rw-r--r--scripts/Dpkg/Control/HashCore.pm3
2 files changed, 4 insertions, 2 deletions
diff --git a/dselect/methods/Dselect/Ftp.pm b/dselect/methods/Dselect/Ftp.pm
index b7f45269c..38c2c5499 100644
--- a/dselect/methods/Dselect/Ftp.pm
+++ b/dselect/methods/Dselect/Ftp.pm
@@ -19,6 +19,7 @@ our $VERSION = '0.02';
use Exporter qw(import);
+use Carp;
use Net::FTP;
use Data::Dumper;
@@ -207,7 +208,7 @@ sub yesno($$) {
$r = -1;
$r = 0 if $d eq 'n';
$r = 1 if $d eq 'y';
- die 'incorrect usage of yesno, stopped' if $r == -1;
+ croak 'incorrect usage of yesno, stopped' if $r == -1;
while (1) {
print $msg, " [$d]: ";
$res = <STDIN>;
diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm
index 9afdafb13..816b100d0 100644
--- a/scripts/Dpkg/Control/HashCore.pm
+++ b/scripts/Dpkg/Control/HashCore.pm
@@ -425,6 +425,7 @@ package Dpkg::Control::HashCore::Tie;
use Dpkg::Checksums;
use Dpkg::Control::FieldsCore;
+use Carp;
use Tie::Hash;
use parent -norequire, qw(Tie::ExtraHash);
@@ -448,7 +449,7 @@ sub new {
sub TIEHASH {
my ($class, $parent) = @_;
- die 'Parent object must be Dpkg::Control::Hash'
+ croak 'parent object must be Dpkg::Control::Hash'
if not $parent->isa('Dpkg::Control::HashCore') and
not $parent->isa('Dpkg::Control::Hash');
return bless [ {}, $$parent ], $class;