[Xml-compile] Crash on new

Mark Overmeer mark at overmeer.net
Thu Dec 1 08:10:26 GMT 2011


* Gary Kennedy (gary at apnic.net) [111201 04:19]:
> 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).

Please forget X::C::Dumper

>  try {
>      $wsdl = XML::Compile::WSDL11->new($wsdl_file, xsi_type => $typemap);
>      $wsdl->importDefinitions($schema_file_list);
>  };
>  if ($@) { die 'error stuff' };
> 
> And when using this module in a script, it drops you back to the
> command prompt after/during the ::WSDL11->new call.

You do no see the "error stuff" error?
The "try{}" catches the error in $@.  So  "die $@" or remove the "try"
block while debugging.

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

Import is called during BEGIN, so when some of the components of
your program may not have been loaded.  Better to use an explicit
Interface->init() or something.
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list