summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Package.pm
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2012-12-31 21:43:39 +0100
committerGuillem Jover <guillem@debian.org>2013-05-04 19:03:13 +0200
commit6a73e3078b01a71d4a6ea90c85da16523ed56f1d (patch)
tree4cc7a210e7e851395f7ba4989e3aac4aa9d32710 /scripts/Dpkg/Package.pm
parent62bc788a45e4a641c28ca9c8c5b9bb08f29faed8 (diff)
downloaddpkg-6a73e3078b01a71d4a6ea90c85da16523ed56f1d.tar.gz
Do not use double-quotes on strings that do not need interpolation
Using double-quotes imposes a small performance penalty as the perl parser needs to check if any interpolation is needed. Use double-quotes only when the string contains single-quotes. Ideally we'd use double-quotes too for escaped meta-characters that might otherwise be confusing to immediately see if they need interpolation or not, but the policy does not (currently) allow to ignore these. Fixes ValuesAndExpressions::ProhibitInterpolationOfLiterals. Warned-by: perlcritic
Diffstat (limited to 'scripts/Dpkg/Package.pm')
-rw-r--r--scripts/Dpkg/Package.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/Dpkg/Package.pm b/scripts/Dpkg/Package.pm
index f3ed4698c..719e3941e 100644
--- a/scripts/Dpkg/Package.pm
+++ b/scripts/Dpkg/Package.pm
@@ -19,7 +19,7 @@ package Dpkg::Package;
use strict;
use warnings;
-our $VERSION = "0.01";
+our $VERSION = '0.01';
use Dpkg::Gettext;
@@ -30,11 +30,11 @@ sub pkg_name_is_illegal($) {
my $name = shift || '';
$name eq '' &&
- return _g("may not be empty string");
+ return _g('may not be empty string');
$name =~ m/[^-+.0-9a-z]/o &&
return sprintf(_g("character '%s' not allowed"), $&);
$name =~ m/^[0-9a-z]/o ||
- return _g("must start with an alphanumeric character");
+ return _g('must start with an alphanumeric character');
return;
}