Skip to content

Commit

Permalink
eliminate use vars
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycoz committed Jun 13, 2020
1 parent c443788 commit ee64a81
Show file tree
Hide file tree
Showing 44 changed files with 150 additions and 120 deletions.
10 changes: 5 additions & 5 deletions CountColor/CountColor.pm
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package Imager::CountColor;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA @EXPORT_OK);
require Exporter;
@EXPORT_OK = 'count_color';
our @EXPORT_OK = 'count_color';

BEGIN {
$VERSION = "0.02";
@ISA = qw(Exporter);
our $VERSION = "0.03";
our @ISA = qw(Exporter);

require XSLoader;
XSLoader::load('Imager::CountColor', $VERSION);
}
Expand Down
4 changes: 2 additions & 2 deletions DynTest/DynTest.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::Filter::DynTest;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.02";
our $VERSION = "0.03";

require XSLoader;
XSLoader::load('Imager::Filter::DynTest', $VERSION);
Expand Down
6 changes: 4 additions & 2 deletions FT2/FT2.pm
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package Imager::Font::FT2;
use 5.006;
use strict;
use Imager;
use Scalar::Util ();
use vars qw($VERSION @ISA);
@ISA = qw(Imager::Font);
our @ISA = qw(Imager::Font);

our $VERSION;

BEGIN {
$VERSION = "0.98";
Expand Down
4 changes: 2 additions & 2 deletions Flines/Flines.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::Filter::Flines;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.03";
our $VERSION = "0.04";

require XSLoader;
XSLoader::load('Imager::Filter::Flines', $VERSION);
Expand Down
4 changes: 2 additions & 2 deletions GIF/GIF.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::File::GIF;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.96";
our $VERSION = "0.96";

require XSLoader;
XSLoader::load('Imager::File::GIF', $VERSION);
Expand Down
4 changes: 2 additions & 2 deletions ICO/ICO.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::File::ICO;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.06";
our $VERSION = "0.07";

require XSLoader;
XSLoader::load('Imager::File::ICO', $VERSION);
Expand Down
2 changes: 2 additions & 0 deletions ICO/lib/Imager/File/CUR.pm
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package Imager::File::CUR;
use 5.006;
use strict;
our $VERSION = "1.000";

# all the work is done by Imager::File::ICO
use Imager::File::ICO;
Expand Down
29 changes: 23 additions & 6 deletions Imager.pm
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package Imager;
use 5.006;

use strict;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS %formats $DEBUG %filters %DSOs $ERRSTR %OPCODES $I2P $FORMATGUESS $warn_obsolete);
use IO::File;
use Scalar::Util;
use Imager::Color;
use Imager::Font;
use Config;

@EXPORT_OK = qw(
our $ERRSTR;

our @EXPORT_OK = qw(
init
init_log
DSO_open
Expand Down Expand Up @@ -89,10 +91,10 @@ use Config;
NCF
);

@EXPORT=qw(
our @EXPORT=qw(
);

%EXPORT_TAGS=
our %EXPORT_TAGS=
(handy => [qw(
newfont
newcolor
Expand Down Expand Up @@ -138,11 +140,13 @@ $combine_types{sat} = $combine_types{saturation};
# this will be used to store global defaults at some point
my %defaults;

our $VERSION;

BEGIN {
require Exporter;
my $ex_version = eval $Exporter::VERSION;
if ($ex_version < 5.57) {
@ISA = qw(Exporter);
our @ISA = qw(Exporter);
}
$VERSION = '1.011';
require XSLoader;
Expand All @@ -161,8 +165,17 @@ my %format_classes =
t1 => "Imager::Font::T1",
);

our %formats;

tie %formats, "Imager::FORMATS", \%formats_low, \%format_classes;

our %filters;

our $DEBUG;
our %OPCODES;
our $FORMATGUESS;
our $warn_obsolete;

BEGIN {
for(i_list_formats()) { $formats_low{$_}++; }

Expand Down Expand Up @@ -526,7 +539,9 @@ END {
}
}

# Load a filter plugin
# Load a filter plugin

our %DSOs;

sub load_plugin {
my ($filename)=@_;
Expand Down Expand Up @@ -2425,6 +2440,8 @@ sub scaleY {
# NOTE - should make a utility function to check transforms for
# stack overruns

our $I2P;

sub transform {
my $self=shift;
my %opts=@_;
Expand Down
4 changes: 2 additions & 2 deletions JPEG/JPEG.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::File::JPEG;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.94";
our $VERSION = "0.94";

require XSLoader;
XSLoader::load('Imager::File::JPEG', $VERSION);
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ t/950-kwalitee/040-strict.t Check use strict is usede
t/950-kwalitee/050-meta.t Check META.yml is valid
t/950-kwalitee/060-podstruct.t
t/950-kwalitee/070-mymeta.t
t/950-kwalitee/080-nousevars.t Check various standards
t/GoodTestFont.pm A dummy (hardly implemented) font driver.
t/Pod/Coverage/Imager.pm
t/t1000lib/Imager/File/BAD.pm Test failing to load a file handler
Expand Down
4 changes: 2 additions & 2 deletions Mandelbrot/Mandelbrot.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::Filter::Mandelbrot;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.04";
our $VERSION = "0.05";

require XSLoader;
XSLoader::load('Imager::Filter::Mandelbrot', $VERSION);
Expand Down
4 changes: 2 additions & 2 deletions PNG/PNG.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::File::PNG;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.95";
our $VERSION = "0.95";

require XSLoader;
XSLoader::load('Imager::File::PNG', $VERSION);
Expand Down
4 changes: 2 additions & 2 deletions SGI/SGI.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::File::SGI;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.04";
our $VERSION = "0.05";

require XSLoader;
XSLoader::load('Imager::File::SGI', $VERSION);
Expand Down
6 changes: 3 additions & 3 deletions T1/T1.pm
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package Imager::Font::T1;
use 5.006;
use strict;
use Imager::Color;
use vars qw(@ISA $VERSION);
@ISA = qw(Imager::Font);
our @ISA = qw(Imager::Font);
use Scalar::Util ();

BEGIN {
$VERSION = "1.027";
our $VERSION = "1.027";

require XSLoader;
XSLoader::load('Imager::Font::T1', $VERSION);
Expand Down
4 changes: 2 additions & 2 deletions TIFF/TIFF.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package Imager::File::TIFF;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);

BEGIN {
$VERSION = "0.92";
our $VERSION = "0.92";

require XSLoader;
XSLoader::load('Imager::File::TIFF', $VERSION);
Expand Down
6 changes: 3 additions & 3 deletions W32/W32.pm
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package Imager::Font::W32;
use 5.006;
use strict;
use Imager;
use vars qw($VERSION @ISA);
@ISA = qw(Imager::Font);
our @ISA = qw(Imager::Font);

BEGIN {
$VERSION = "0.91";
our $VERSION = "0.91";

require XSLoader;
XSLoader::load('Imager::Font::W32', $VERSION);
Expand Down
6 changes: 4 additions & 2 deletions W32/lib/Imager/Font/Win32.pm
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package Imager::Font::Win32;
use 5.006;
use strict;
use vars qw(@ISA);
@ISA = qw(Imager::Font::W32);
our @ISA = qw(Imager::Font::W32);

our $VERSION = "1.000";

require Imager::Font::W32;

Expand Down
5 changes: 2 additions & 3 deletions lib/Imager/Color.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package Imager::Color;

use 5.006;
use Imager;
use strict;
use vars qw($VERSION);

$VERSION = "1.013";
our $VERSION = "1.013";

# It's just a front end to the XS creation functions.

Expand Down
5 changes: 2 additions & 3 deletions lib/Imager/Color/Float.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package Imager::Color::Float;

use 5.006;
use Imager;
use strict;
use vars qw($VERSION);

$VERSION = "1.006";
our $VERSION = "1.006";

# It's just a front end to the XS creation functions.

Expand Down
4 changes: 2 additions & 2 deletions lib/Imager/Color/Table.pm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package Imager::Color::Table;
use strict;
use vars qw($VERSION);
use 5.006;

$VERSION = "1.003";
our $VERSION = "1.004";

my %colors;

Expand Down
11 changes: 4 additions & 7 deletions lib/Imager/Expr.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package Imager::Expr;

use 5.006;
use Imager::Regops;
use strict;
use vars qw($VERSION);

$VERSION = "1.007";
our $VERSION = "1.008";

my %expr_types;

Expand Down Expand Up @@ -296,8 +295,7 @@ sub dumpcode {
}

package Imager::Expr::Postfix;
use vars qw(@ISA);
@ISA = qw(Imager::Expr);
our @ISA = qw(Imager::Expr);

Imager::Expr::Postfix->register_type('rpnexpr');

Expand All @@ -319,8 +317,7 @@ sub compile {

package Imager::Expr::Infix;

use vars qw(@ISA);
@ISA = qw(Imager::Expr);
our @ISA = qw(Imager::Expr);
use Imager::Regops qw(%Attr $MaxOperands);

{
Expand Down
7 changes: 3 additions & 4 deletions lib/Imager/Expr/Assem.pm
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package Imager::Expr::Assem;
use 5.006;
use strict;
use Imager::Expr;
use Imager::Regops;
use vars qw($VERSION);

$VERSION = "1.003";
our $VERSION = "1.004";

use vars qw(@ISA);
@ISA = qw(Imager::Expr);
our @ISA = qw(Imager::Expr);

__PACKAGE__->register_type('assem');

Expand Down
5 changes: 2 additions & 3 deletions lib/Imager/ExtUtils.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package Imager::ExtUtils;
use 5.006;
use strict;
use File::Spec;

use vars qw($VERSION);

$VERSION = "1.002";
our $VERSION = "1.003";

=head1 NAME
Expand Down
Loading

0 comments on commit ee64a81

Please sign in to comment.