Skip to content

Commit

Permalink
Switch to using XSLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
toddr committed Sep 24, 2019
1 parent 56b0509 commit 15b5471
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Expat/Expat.pm
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package XML::Parser::Expat;

require 5.004;

use strict;
our ( %Encoding_Table, @Encoding_Path, $have_File_Spec );
use Carp;

require DynaLoader;
#use warnings; No warnings numeric??

use XSLoader;
use Carp;

our @ISA = qw(DynaLoader);
our $VERSION = '2.44_01';

$have_File_Spec = $INC{'File/Spec.pm'} || do 'File/Spec.pm';
our ( %Encoding_Table, @Encoding_Path, $have_File_Spec );

use File::Spec ();

%Encoding_Table = ();
if ($have_File_Spec) {
Expand All @@ -26,7 +26,7 @@ else {
@Encoding_Path = ( grep( -d $_, map( $_ . '/XML/Parser/Encodings', @INC ) ), '.' );
}

bootstrap XML::Parser::Expat $VERSION;
XSLoader::load( 'XML::Parser::Expat', $VERSION );

our %Handler_Setters = (
Start => \&SetStartElementHandler,
Expand Down Expand Up @@ -498,7 +498,7 @@ sub parsestring {
sub parsefile {
my $self = shift;
croak 'Parser has already been used' if $self->{_State_};

open( my $fh, '<', $_[0] ) or croak "Couldn't open $_[0]:\n$!";
binmode($fh);
my $ret = $self->parse($fh);
Expand Down

0 comments on commit 15b5471

Please sign in to comment.