aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-14 02:19:06 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-14 02:19:06 +1300
commit9cd3e6615cf6b1b285f8ed4d181a22c29ce18db0 (patch)
tree931dbf77ffddf737eb9af10f706142106b1c8260
parentUse a nicer example passphrase (diff)
downloadMail-Run-Crypt-9cd3e6615cf6b1b285f8ed4d181a22c29ce18db0.tar.gz
Mail-Run-Crypt-9cd3e6615cf6b1b285f8ed4d181a22c29ce18db0.zip
Test existence and definedness for hash options
-rw-r--r--lib/Mail/Run/Crypt.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Mail/Run/Crypt.pm b/lib/Mail/Run/Crypt.pm
index b20a0d7..cc24144 100644
--- a/lib/Mail/Run/Crypt.pm
+++ b/lib/Mail/Run/Crypt.pm
@@ -31,7 +31,7 @@ sub new {
my $self = {%opts};
# We must have a recipient
- defined $self->{mailto}
+ exists $self->{mailto} and defined $self->{mailto}
or croak 'mailto required';
# Default the instance name to the package name if it wasn't given;
@@ -44,9 +44,9 @@ sub new {
# If signing, we need a key ID and a passphrase
if ( $self->{sign} ) {
- defined $self->{keyid}
+ exists $self->{keyid} and defined $self->{keyid}
or croak 'keyid required for signing';
- defined $self->{passphrase}
+ exists $self->{passphrase} and defined $self->{passphrase}
or croak 'passphrase required for signing';
}