in reply to XML::Simple and use lib

BioHazard,
With neither code nor logs, it is difficult to help you. I would suggest running your source file from the command line to see quickly what is going on. Running it from the command line will give you a better out put than Code 500.

If you don't find anything that way then use the debugger. Failing that, request the Apache logs from your provider.

You may also want to post your code here so that we can have a look at it. Someone here (probably Abigail-II) will know what is going on right away

Kristofer

Replies are listed 'Best First'.
Re: Re: XML::Simple and use lib
by BioHazard (Pilgrim) on Aug 16, 2002 at 18:49 UTC
    Oh, sorry about that: Here's a piece of my code:

    #!/usr/bin/perl use strict; use lib "/www/htdocs/v028502/cgi-bin/Modules/"; use CGI; # does not need use lib use HTML::Template; # does need use lib and works fine use XML::Simple; # does need use lib but doesn't work correctly (XMLou +t() works) use LWP::Simple; # does need use lib and works fine, too. my $q = new CGI; my $name = $q->param('name'); $name = lc($name); my $xml = XMLin("$name.xml", searchpath => ['users']); # NOT possible +on the Linux machine! print $q->header('text/html'); # HTML Header print "$xml->{email}<br>$xml->{adress}"; # For Example... exit;
    I can not run my source file from the command line, because it is the machine of my ISP. On my local webserver it works absolutely fine, also in the command line. I even asked for the error logs, but they didn't send it to me yet.
    I hope I made my problem a bit more clear.

      Since you don't have access to logs or command line, here is what I would suggest. Change the line
      <i>my $xml = XMLin("$name.xml", searchpath => ['users']);</i>
      to...

      my $xml = XMLin("$name.xml", searchpath => ['users']); use Data::Dumper; print "<pre>" . Dumper($xml) . "</pre>";


      Then look for an element named 'adress'. I would assume you mean 'address' from the following line.
      <i>print $xml->{email}<br>$xml->{adress}</i>

      --Kristofer

      Updated: added code tags

      if you don't have access to your error logs and XMLin() seems to be where it's dieing, maybe try something like:

      print $q->header(); my $xml; eval { $xml = XMLin("$name.xml", searchpath => ['users']); }; if($@) { print "the error was: <pre>$@</pre>"; } else { print "no error was generated."; }

      anders pearson

        Hallo thraxil!

        Thank you for your help, and of course I thank all of you.
        With eval() I was now able to know WHAT exactly failed. And that's the output:

        the error was: 
        XML::Parser::Expat object version 2.30 does not match bootstrap parameter 2.27 at /usr/lib/perl5/5.6.1/i386-linux/DynaLoader.pm line 225.
        Compilation failed in require at /www/htdocs/v028502/cgi-bin/Modules/XML/Parser.pm line 15.
        BEGIN failed--compilation aborted at /www/htdocs/v028502/cgi-bin/Modules/XML/Parser.pm line 27.
        Compilation failed in require at /www/htdocs/v028502/cgi-bin/Modules/XML/Simple.pm line 224.


        Now I'm going to read through the module-lines failed in the execution.
        Does anyone have an idea what is ment by "bootstrap parameter" ? Sorry about my little knowledge.