summaryrefslogtreecommitdiff
path: root/dist/Locale-Maketext
diff options
context:
space:
mode:
authorNicolas R <atoomic@cpan.org>2017-09-12 13:20:25 -0600
committerTodd Rinaldo <toddr@cpan.org>2017-11-11 01:07:18 -0600
commit1a58b39af83e11fcbeef7ae4cd90c565b1f6b8cb (patch)
tree542b8e3ec768e2b3a533354d694d53c6c161e8e5 /dist/Locale-Maketext
parent33394adc9b131beee7dbbaf29bc7e8e02900f654 (diff)
downloadperl-1a58b39af83e11fcbeef7ae4cd90c565b1f6b8cb.tar.gz
Replace multiple 'use vars' by 'our' in dist
Using vars pragma is discouraged and has been superseded by 'our' declarations available in Perl v5.6.0 or later. Additionally using 'vars' pragma increase the memory consumption of a program by about 700 kB for no good reason. This commit is about replacing the usage of 'vars' pragma by 'our' in blead where it makes sense. ( leaving 'cpan' directory outside of the scope ) -- using vars perl -e 'use vars qw(@ISA $AUTOLOAD $VERSION); print qx{grep RSS /proc/$$/status} ' VmRSS: 2588 kB -- using our instead perl -e 'our (@ISA, $AUTOLOAD, $VERSION); print qx{grep RSS /proc/$$/status} ' VmRSS: 1864 kB
Diffstat (limited to 'dist/Locale-Maketext')
-rw-r--r--dist/Locale-Maketext/lib/Locale/Maketext.pm13
-rw-r--r--dist/Locale-Maketext/lib/Locale/Maketext.pod2
-rw-r--r--dist/Locale-Maketext/t/60_super.t15
-rw-r--r--dist/Locale-Maketext/t/70_fail_auto.t6
4 files changed, 15 insertions, 21 deletions
diff --git a/dist/Locale-Maketext/lib/Locale/Maketext.pm b/dist/Locale-Maketext/lib/Locale/Maketext.pm
index 36d0c05566..f70438b78d 100644
--- a/dist/Locale-Maketext/lib/Locale/Maketext.pm
+++ b/dist/Locale-Maketext/lib/Locale/Maketext.pm
@@ -1,7 +1,6 @@
package Locale::Maketext;
use strict;
-use vars qw( @ISA $VERSION $MATCH_SUPERS $USING_LANGUAGE_TAGS
-$USE_LITERALS $MATCH_SUPERS_TIGHTLY);
+our $USE_LITERALS;
use Carp ();
use I18N::LangTags ();
use I18N::LangTags::Detect ();
@@ -26,12 +25,12 @@ BEGIN {
}
-$VERSION = '1.28';
-@ISA = ();
+our $VERSION = '1.29';
+our @ISA = ();
-$MATCH_SUPERS = 1;
-$MATCH_SUPERS_TIGHTLY = 1;
-$USING_LANGUAGE_TAGS = 1;
+our $MATCH_SUPERS = 1;
+our $MATCH_SUPERS_TIGHTLY = 1;
+our $USING_LANGUAGE_TAGS = 1;
# Turning this off is somewhat of a security risk in that little or no
# checking will be done on the legality of tokens passed to the
# eval("use $module_name") in _try_use. If you turn this off, you have
diff --git a/dist/Locale-Maketext/lib/Locale/Maketext.pod b/dist/Locale-Maketext/lib/Locale/Maketext.pod
index 564e5afd0b..24c8f24d8f 100644
--- a/dist/Locale-Maketext/lib/Locale/Maketext.pod
+++ b/dist/Locale-Maketext/lib/Locale/Maketext.pod
@@ -1226,7 +1226,7 @@ If you get tired of constantly saying C<print $lh-E<gt>maketext>,
consider making a functional wrapper for it, like so:
use Projname::L10N;
- use vars qw($lh);
+ our $lh;
$lh = Projname::L10N->get_handle(...) || die "Language?";
sub pmt (@) { print( $lh->maketext(@_)) }
# "pmt" is short for "Print MakeText"
diff --git a/dist/Locale-Maketext/t/60_super.t b/dist/Locale-Maketext/t/60_super.t
index d54fc33007..5ac095910e 100644
--- a/dist/Locale-Maketext/t/60_super.t
+++ b/dist/Locale-Maketext/t/60_super.t
@@ -9,23 +9,20 @@ BEGIN {
{
package Whunk::L10N;
- use vars qw(@ISA %Lexicon);
- @ISA = 'Locale::Maketext';
- %Lexicon = ('hello' => 'SROBLR!');
+ our @ISA = 'Locale::Maketext';
+ our %Lexicon = ('hello' => 'SROBLR!');
}
{
package Whunk::L10N::en;
- use vars qw(@ISA %Lexicon);
- @ISA = 'Whunk::L10N';
- %Lexicon = ('hello' => 'HI AND STUFF!');
+ our @ISA = 'Whunk::L10N';
+ our %Lexicon = ('hello' => 'HI AND STUFF!');
}
{
package Whunk::L10N::zh_tw;
- use vars qw(@ISA %Lexicon);
- @ISA = 'Whunk::L10N';
- %Lexicon = ('hello' => 'NIHAU JOE!');
+ our @ISA = 'Whunk::L10N';
+ our %Lexicon = ('hello' => 'NIHAU JOE!');
}
$ENV{'REQUEST_METHOD'} = 'GET';
diff --git a/dist/Locale-Maketext/t/70_fail_auto.t b/dist/Locale-Maketext/t/70_fail_auto.t
index 44fe54d1b5..df0de3eb3c 100644
--- a/dist/Locale-Maketext/t/70_fail_auto.t
+++ b/dist/Locale-Maketext/t/70_fail_auto.t
@@ -9,14 +9,12 @@ BEGIN {
{
package Whunk::L10N;
- use vars qw(@ISA);
- @ISA = 'Locale::Maketext';
+ our @ISA = 'Locale::Maketext';
}
{
package Whunk::L10N::en;
- use vars qw(@ISA);
- @ISA = 'Whunk::L10N';
+ our @ISA = 'Whunk::L10N';
}
my $lh = Whunk::L10N->get_handle('en');