Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove no warnings 'redefine'; and correctly load dependences #106

Merged
merged 1 commit into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Unicode/Unicode.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package Encode::Unicode;

use strict;
use warnings;
no warnings 'redefine';

our $VERSION = do { my @r = ( q$Revision: 2.15 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };

Expand All @@ -13,7 +12,7 @@ XSLoader::load( __PACKAGE__, $VERSION );
# Object Generator 8 transcoders all at once!
#

require Encode;
use Encode ();

our %BOM_Unknown = map { $_ => 1 } qw(UTF-16 UTF-32);

Expand Down
5 changes: 2 additions & 3 deletions lib/Encode/Alias.pm
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package Encode::Alias;
use strict;
use warnings;
no warnings 'redefine';
our $VERSION = do { my @r = ( q$Revision: 2.21 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};

use Encode ();

use Exporter 'import';

# Public, encouraged API is exported by default
Expand All @@ -19,7 +20,6 @@ our @Alias; # ordered matching list
our %Alias; # cached known aliases

sub find_alias {
require Encode;
my $class = shift;
my $find = shift;
unless ( exists $Alias{$find} ) {
Expand Down Expand Up @@ -134,7 +134,6 @@ sub undef_aliases {
}

sub init_aliases {
require Encode;
undef_aliases();

# Try all-lower-case version should all else fails
Expand Down
12 changes: 4 additions & 8 deletions lib/Encode/Encoding.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ our $VERSION = do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); sprintf "%d." . "%0

our @CARP_NOT = qw(Encode Encode::Encoder);

require Encode;
use Carp ();
use Encode ();
use Encode::MIME::Name;

sub DEBUG { 0 }

Expand All @@ -22,13 +24,10 @@ sub Define {

sub name { return shift->{'Name'} }

sub mime_name{
require Encode::MIME::Name;
sub mime_name {
return Encode::MIME::Name::get_mime_name(shift->name);
}

# sub renew { return $_[0] }

sub renew {
my $self = shift;
my $clone = bless {%$self} => ref($self);
Expand Down Expand Up @@ -58,14 +57,12 @@ sub fromUnicode { shift->encode(@_) }
#

sub encode {
require Carp;
my $obj = shift;
my $class = ref($obj) ? ref($obj) : $obj;
Carp::croak( $class . "->encode() not defined!" );
}

sub decode {
require Carp;
my $obj = shift;
my $class = ref($obj) ? ref($obj) : $obj;
Carp::croak( $class . "->encode() not defined!" );
Expand Down Expand Up @@ -190,7 +187,6 @@ MUST return the string representing the canonical name of the encoding.
Predefined As:

sub mime_name{
require Encode::MIME::Name;
return Encode::MIME::Name::get_mime_name(shift->name);
}

Expand Down
3 changes: 1 addition & 2 deletions lib/Encode/Unicode/UTF7.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
package Encode::Unicode::UTF7;
use strict;
use warnings;
no warnings 'redefine';
use parent qw(Encode::Encoding);
__PACKAGE__->Define('UTF-7');
our $VERSION = do { my @r = ( q$Revision: 2.9 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
use MIME::Base64;
use Encode;
use Encode qw(find_encoding);

#
# Algorithms taken from Unicode::String by Gisle Aas
Expand Down