[Xml-compile] Crash on new

Gary Kennedy gary at apnic.net
Thu Dec 1 04:19:27 GMT 2011


Ok, I'm using XCW as the internals of an interface module.

To save execution time I'm compiling everything when the module gets imported. (Yes, I now know about XML::Compiler::Dumper, but this is all written and time critical so new modules later).

Basically I have:

    package Interface;
    use strict;
    use warnings;
    use Log::Report;
    use XML::Compile::WSDL11;
    use XML::Compile::SOAP11;
    use XML::Compile::Transport::SOAPHTTP;

    sub import {
        # .. import stuff
        setup();
    }

    sub setup {
        my $wsdl;
        try {
            $wsdl = XML::Compile::WSDL11->new($wsdl_file, xsi_type => $typemap);
            $wsdl->importDefinitions($schema_file_list);
        };
        if ($@) { die 'error stuff' };

        # .. extra setup
    }
    1;

And when using this module in a script, it drops you back to the command prompt after/during the ::WSDL11->new call.

It still runs END blocks so it's not technically a crash I suppose, but it's still not nice.

Now, if I comment out the setup() call in the import block, and manually run setup in the script, it all works fine.

I have absolutely no idea why this is happening, any ideas?

Thanks,
Gary




More information about the Xml-compile mailing list