Loading ...
Sorry, an error occurred while loading the content.

1269server script package puzzlement

Expand Messages
  • gyles19
    Mar 1, 2002
      I'm prototyping a distributed build system modeled vaguely after
      Mozilla's Tinderbox, but using SOAP for the message passing.

      I have a client/server pair which allows me to trigger a build and
      receive a result. That's working just fine.

      The problem I'm having is possibly just a misunderstanding on my part
      regarding packages and SOAP methods, so I expect the answer is a
      'duh', but I sure can't find it.

      Here's a snippet of code I've been working on all afternoon:

      use SOAP::Lite +trace => 'all';
      use SOAP::Transport::HTTP;

      SOAP::Transport::HTTP::CGI
      -> dispatch_to('cvsBuildC')
      -> options({compress_threshold => 10000})
      -> handle;

      package cvsBuildC;

      use strict;
      use vars qw($foobar);
      $foobar = "Baz";

      sub build {
      my $self=shift;
      ....
      print STDERR "Foobar=";
      print STDERR $foobar;
      print STDERR $cvsBuildC::foobar;
      print STDERR $self->foobar;
      }

      Basically, I have been totally unsuccessful at getting my soap methods
      to access global variables of *any* sort. If I don't define it
      directly within the method, it doesn't exist when I need it later.

      I've studied every exmaple of soap server code I can find using global
      or package variables, and duplicated the presense/absense of 'use
      strict', 'use vars qw($foobar)', and package reference methods, but
      every one of them ends up giving me "Foobar=" with no value. The only
      version that works is when I explicitly define 'my $foobar="crap!"'
      directly in the build method.

      What I really want to do is to be able to define globals that contain
      static information like the paths to data, local commands, settings,
      etc. The lack of a functional global variable has already cost me
      time today because I've had to put them directly into the various
      methods, and I missed a change. :p


      I'm using perl 5.6.1 and SoapLite 0.51, along with everything needed
      from CPAN as of Monday morning, so I'm pretty sure everything is current.

      Any suggestions as to what might be wrong with my code would be most
      welcome. Thanks for your time!
    • Show all 4 messages in this topic