in reply to XML::Twig Support for Parameter Entities

Do you have the module URI or URI::File or LWP installed? The code appears to say that you don't have any of them. I tried to search for where you said whether or not you had these modules installed, but my searches failed (and I didn't feel like reading every single word of what you wrote -- so I apologize in advance if you did actually say that somewhere).

- tye        

  • Comment on Re: XML::Twig Support for Parameter Entities (installed?)

Replies are listed 'Best First'.
Re^2: XML::Twig Support for Parameter Entities (installed?)
by Anonymous Monk on Aug 13, 2015 at 03:48 UTC

    Do you have the module URI or URI::File or LWP installed?...

    :) I thought of that too, op said I have installed Strawberry Perl v.5.22.0.1 on Windows 7 and therefore use so http://strawberryperl.com/release-notes/5.22.0.1-32bit.html

    they are installed

    XML::Twig docs warn that these parts are not well tested, heck they're not even documented

      I did look at Corelist and got the impression that none of these are "core" modules. But I didn't look at what non-"core" modules Strawberry includes by default.

      Looking at the code for _use():

      sub _use ## no critic (Subroutines::ProhibitNestedSubs); { my( $module, $version)= @_; ... if( eval "require $module") { ...

      Perhaps they have something loaded that is changing the return value from 'require'? It is pretty darn rare for people to care about the return value from a 'require', which is why I'd write such code as:

      if( eval "require $module; 1" ) { ...

      I'd also try "require LWP" and see what Perl says in response. It would be good to change Twig so that $@ from one of the _use() calls would be appended to the "cannot expand %dtd; - cannot load 'http://127.0.0.1:5000/parameterEntity_core.dtd'" error messages. [ People often seem to underrate the value of error messages. :) ]

      - tye        

        It is pretty darn rare for people to care about the return value from a 'require'

        I used that quite often, as in

        use Data::Dumper; sub DEVEL() { 1 }; # get sample data my hashref = DEVEL ? require 'sampledata.pl' : do_something_costly(); # later on if ( DEVEL ) { open my $fh, 'sampledata.pl' or die "sampledata.pl: $!"; print Dumper($hashref); }

        Also, I use function files for autoloading (function.al) which return an anonymous sub and encapsulate private data in their lexical file scope (see also AutoReloader).

        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
        Hi, I use LWP in my unit tests.
        Example code:
        require LWP::UserAgent; [other stuff] #reset the counter $ua = LWP::UserAgent->new; $request = $ua->get($URL.'/reset'); [other stuff]
        However I also included "require LWP;" in my sample code.
        I get no error messages/warnings; The code still works fine. Chris