diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-14 10:19:50 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-01-14 11:24:20 +0000 |
commit | 799cd59b1d05fee1b98c83b3a39f12917ded9a91 (patch) | |
tree | 377d595e46ee4d682b7650d79e502fbafdd68f60 /perllib/FixMyStreet/Roles/Abuser.pm | |
parent | 018da215a8c056f680202f128e0355c662b74c7f (diff) |
Remove any use of `my $x if $foo`.
As perlsyn says, "NOTE: The behaviour of a `my`, `state`, or `our`
modified with a statement modifier conditional or loop construct (for
example, `my $x if ...`) is undefined. The value of the `my` variable
may be `undef`, any previously assigned value, or possibly anything
else."
Diffstat (limited to 'perllib/FixMyStreet/Roles/Abuser.pm')
-rw-r--r-- | perllib/FixMyStreet/Roles/Abuser.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Roles/Abuser.pm b/perllib/FixMyStreet/Roles/Abuser.pm index e2e9eb19e..7510e6bc2 100644 --- a/perllib/FixMyStreet/Roles/Abuser.pm +++ b/perllib/FixMyStreet/Roles/Abuser.pm @@ -14,7 +14,8 @@ sub is_from_abuser { my $self = shift; my $email = $self->user->email; - my ($domain) = $email =~ m{ @ (.*) \z }x if $email; + my $domain; + ($domain) = $email =~ m{ @ (.*) \z }x if $email; my $phone = $self->user->phone; # search for an entry in the abuse table |