From 24df99399ba5b63dc354ff49ea8622a8ca1cd17d Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 12 Sep 2014 06:08:37 +0200 Subject: perl: Use length instead of /^$/ to test for an empty string Addresses RegularExpressions::ProhibitFixedStringMatches. Warned-by: perlcritic --- scripts/Dpkg/Control/HashCore.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/Dpkg/Control/HashCore.pm') diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm index 74732724b..67b264a48 100644 --- a/scripts/Dpkg/Control/HashCore.pm +++ b/scripts/Dpkg/Control/HashCore.pm @@ -197,7 +197,7 @@ sub parse { while (<$fh>) { s/\s*\n$//; - next if (m/^$/ and $paraborder); + next if length == 0 and $paraborder; next if (m/^#/); $paraborder = 0; if (m/^(\S+?)\s*:\s*(.*)$/) { @@ -232,7 +232,7 @@ sub parse { } else { $self->parse_error($desc, _g('OpenPGP signature not allowed here')); } - } elsif (m/^$/ || ($expect_pgp_sig && m/^-----BEGIN PGP SIGNATURE-----$/)) { + } elsif (length == 0 || ($expect_pgp_sig && m/^-----BEGIN PGP SIGNATURE-----$/)) { if ($expect_pgp_sig) { # Skip empty lines $_ = <$fh> while defined && m/^\s*$/; @@ -356,7 +356,7 @@ sub output { $kv .= "\n"; foreach (@lines) { s/\s+$//; - if (/^$/ or /^\.+$/) { + if (length == 0 or /^\.+$/) { $kv .= " .$_\n"; } else { $kv .= " $_\n"; -- cgit v1.2.3