I've found a workaround until and unless I can get DDS fixed. If you
replace that empty hash reference {} with a hash reference containing an
empty list {()}, it compiles OK. I've attached a reduced test case that
demonstrates the difference.
Would you consider using this syntax as a workaround to XML::Compile::SOAP
for now?
my @pairs = ( %{delete $data->{Header} || {()}}
, %{delete $data->{Body} || {()}});
--
Mark Gardner $ <[email protected]>
On Mon, Mar 23, 2015 at 6:06 PM, Mark Overmeer <[email protected]> wrote:
> * Mark Gardner ([email protected]) [150323 21:10]:
> > syntax error at lib/WebService/Avalara/AvaTax/TaxSvc.pm line 4459, near
> > "%{{} unless"
> > syntax error at lib/WebService/Avalara/AvaTax/TaxSvc.pm line 4459, near
> ";}"
> > Unmatched right curly bracket at lib/WebService/Avalara/AvaTax/TaxSvc.pm
> > line 4459, at end of line
> > Unmatched right curly bracket at lib/WebService/Avalara/AvaTax/TaxSvc.pm
> > line 4466, at end of line
> > syntax error at lib/WebService/Avalara/AvaTax/TaxSvc.pm line 4466, near
> "}"
>
> Not all Data::Dump::Streamer versions have the same bugs.
>
> It apparently decodes
>
> lib/XML/Compile/SOAP.pm
> my @pairs = ( %{delete $data->{Header} || {}}
> , %{delete $data->{Body} || {}});
>
>
> into
> my(@pairs) = ( %{{} unless delete $$data{'Header'};}
> , %{{} unless delete $$data{'Body'};});
>
> which is explainable but incorrect Perl.
> You may be able to get this resolved.
>
> XML::Compile::Dumper may not help your performance at all:
> Data::Dump::Streamer should have some de-duplication implemented.
> --
> Regards,
>
> MarkOv
>
> ------------------------------------------------------------------------
> Mark Overmeer MSc MARKOV Solutions
> [email protected] [email protected]
> http://Mark.Overmeer.net http://solutions.overmeer.net
>
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dump::Streamer;
for (qw(testcase1 testcase2)) {
print "running $_\n";
no strict 'refs';
Dump(&$_);
print "evaling $_\n";
eval_dump( \&$_ );
}
sub eval_dump {
my $code_ref = shift;
no strict 'vars';
if ( eval Dump($code_ref)->Out() ) { Dump($code_ref) }
else { print "$@\n"; Dump($code_ref) }
}
sub testcase1 {
my $data = {
Header => { foo => 1 },
Body => { bar => 2 },
};
my (@pairs) = ( %{ delete $data->{Header} || {} } );
$data;
}
sub testcase2 {
my $data = {
Header => { foo => 1 },
Body => { bar => 2 },
};
my (@pairs) = ( %{ delete $data->{Header} || { () } } );
$data;
}
_______________________________________________
Xml-compile mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile