Skip to content
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
16 changes: 8 additions & 8 deletions Expat/Expat.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use Carp;
require DynaLoader;

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

$have_File_Spec = $INC{'File/Spec.pm'} || do 'File/Spec.pm';

Expand Down Expand Up @@ -112,7 +112,7 @@ sub setHandlers {
while (@handler_pairs) {
my $type = shift @handler_pairs;
my $handler = shift @handler_pairs;
croak "Handler for $type not a Code ref"
croak 'Handler for $type not a Code ref'
unless (! defined($handler) or ! $handler or ref($handler) eq 'CODE');

my $hndl = $self->{_Setters}->{$type};
Expand Down Expand Up @@ -146,7 +146,7 @@ sub xpcarp {

my $eclines = $self->{ErrorContext};
my $line = GetCurrentLineNumber($_[0]->{Parser});
$message .= " at line $line";
$message .= ' at line $line';
$message .= ":\n" . $self->position_in_context($eclines)
if defined($eclines);
carp $message;
Expand Down Expand Up @@ -435,7 +435,7 @@ sub DESTROY {
sub parse {
my $self = shift;
my $arg = shift;
croak "Parse already in progress (Expat)" if $self->{_State_};
croak 'Parse already in progress (Expat)' if $self->{_State_};
$self->{_State_} = 1;
my $parser = $self->{Parser};
my $ioref;
Expand Down Expand Up @@ -466,7 +466,7 @@ sub parse {
my $delim = $self->{Stream_Delimiter};
my $prev_rs;
my $ioclass = ref $ioref;
$ioclass = "IO::Handle" if !length $ioclass;
$ioclass = 'IO::Handle' if !length $ioclass;

$prev_rs = $ioclass->input_record_separator("\n$delim\n")
if defined($delim);
Expand All @@ -490,7 +490,7 @@ sub parsestring {

sub parsefile {
my $self = shift;
croak "Parser has already been used" if $self->{_State_};
croak 'Parser has already been used' if $self->{_State_};
local(*FILE);
open(FILE, $_[0]) or croak "Couldn't open $_[0]:\n$!";
binmode(FILE);
Expand Down Expand Up @@ -560,10 +560,10 @@ sub asString {
$ret = $self->{Tag};
}
elsif ($self->{Type} == EMPTY) {
return "EMPTY";
return 'EMPTY';
}
elsif ($self->{Type} == ANY) {
return "ANY";
return 'ANY';
}
elsif ($self->{Type} == MIXED) {
$ret = '(#PCDATA';
Expand Down
16 changes: 8 additions & 8 deletions Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ sub new {
$stylepkg = "\u$style";

eval {
my $fullpkg = 'XML::Parser::Style::' . $stylepkg;
my $fullpkg = "XML::Parser::Style::$stylepkg";
my $stylefile = $fullpkg;
$stylefile =~ s/::/\//g;
require "$stylefile.pm";
$stylepkg = $fullpkg;
};
if ($@) {
# fallback to old behaviour
$stylepkg = 'XML::Parser::' . $stylepkg;
$stylepkg = "XML::Parser::$stylepkg";
}
}

my $htype;
foreach $htype (keys %{$args{_HNDL_TYPES}}) {

for my $htype (keys %{$args{_HNDL_TYPES}}) {
# Handlers explicitly given override
# handlers from the Style package
unless (defined($handlers->{$htype})) {
Expand Down Expand Up @@ -110,7 +110,7 @@ sub new {
sub setHandlers {
my ($self, @handler_pairs) = @_;

croak("Uneven number of arguments to setHandlers method")
croak('Uneven number of arguments to setHandlers method')
if (int(@handler_pairs) & 1);

my @ret;
Expand Down Expand Up @@ -264,9 +264,9 @@ sub initial_ext_ent_handler {

$LWP_load_failed = 1;

my $cmsg = "Couldn't load LWP based external entity handler\n";
$cmsg .= "Switching to file-based external entity handler\n";
$cmsg .= " (To avoid this message, use NoLWP option to XML::Parser)\n";
my $cmsg = "Couldn't load LWP based external entity handler\n"
. "Switching to file-based external entity handler\n"
. " (To avoid this message, use NoLWP option to XML::Parser)\n";
warn($cmsg);
}

Expand Down