Hi all,

I'm hoping one of you kind souls can point out where, exactly, I'm being a bit dim, as the problem I have, well it just has to be something really simple, but I just can't see it...

I have a SOAP server:

#!/usr/local/bin/perl use strict; use warnings; use SOAP::Transport::HTTP; $|++; my $daemon = SOAP::Transport::HTTP::Daemon -> new( LocalAddr => 'localhost', LocalPort => 8080, R +euse => 1 ) -> dispatch_to('/Users/johno/Code/DCI/Wordbank-DCI-Ser +ver/lib'); print STDERR "SOAP server startup at ", $daemon->url, "\nServer INC:", + join(' ', @INC), "\n"; $daemon->handle;

...which is called from the following client:

#!/usr/local/bin/perl use strict; use warnings; #use SOAP::Lite +trace => ['all', '-transport']; use SOAP::Lite; my $soap = SOAP::Lite->new( uri => 'http://DCI/Wordbank::DCI::Server', proxy => 'http://10.1.1.50:8080/Server', on_fault => sub { my($soap, $res) = @_; die ref $res ? $res->faultdetail : $soap->tran +sport->status, "\n"; }); print $soap->hello()->result, "\n";

...and the server calls the following module:

package Wordbank::DCI::Server; use vars qw(@ISA); @ISA = qw(SOAP::Server::Parameters); use strict; use warnings; use Carp; sub hello { my $self = shift; print STDERR 'Module INC: ', join(' ', @INC), "\n"; return "Hello, world\n"; } 1;

All of which works perfectly, calls the hello method, and prints out quite a reasonable @INC value. Until I add in use Data::Dumper immediately after the use Carp line in the module, at which point I get the following (excerpted) error when I turn tracing on:

<soap:Fault><faultcode>soap:Client</faultcode><faultstring>Failed to a +ccess class (Wordbank::DCI::Server): Can't locate Data/Dumper.pm in @ +INC (@INC contains: /Users/johno/Code/DCI/Wordbank-DCI-Server/lib) at + /Users/johno/Code/DCI/Wordbank-DCI-Server/lib/Wordbank/DCI/Server.pm + line 9. BEGIN failed--compilation aborted at /Users/johno/Code/DCI/Wordbank-DC +I-Server/lib/Wordbank/DCI/Server.pm line 9. Compilation failed in require at (eval 98) line 3. </faultstring><faultactor>http://localhost:8080/</faultactor></soap:Fa +ult>

...i.e. it appears that @INC is getting zapped to only contain the current module's directory. I can't even use lib... something to get around it as it can't use 'lib'.

Can anyone reproduce this? Am I being a complete klutz? Hay-ulp...

(OSX 10.4.8, Perl 5.8.8, SOAP::Lite 0.69)


Update:

Thanks to both almut and Ultra for both speedy and accurate replies.


In reply to @INC problem with SOAP::Lite by john_oshea

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.