Hi,

Following on from the earlier thread about storing common code in a 
central file, I have hit a problem when trying to do something 
similar.

I have been toying with SOAP. There seems to be a number of ways to 
create SOAP services and I opted for one of the examples at 
guide.soaplite.com.

So my code looks a bit like this at the moment:

========== test.pl ==========
#!/usr/bin/perl

use strict;
use warnings;
use Mymodule qw($server);
use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
        ->dispatch_to('Test')
        ->handle;

package Test;           # Is this the problem?

sub hi {
        return "Hello World";
}

sub bye {
        return "It's all over";
}

sub Mysub {
        return "Variable \$server=$server";
}

=====================

Mymodule looks like this:

=========== Mymodules.pm ==========
package MyModule;

require Exporter;
use strict;
use warnings;
use SOAP::Lite;

our @ISA        = qw(Exporter);
our @EXPORT     = qw($server $name);
our $VERSION    = 1.00;

our $server = 'localhost.somedomain.com';
our $name = 'Smithe';

1;
==========================

When I run perl -c test.pl I get 
Global symbol "$server" requires explicit package name at test.pl 
line 25.
test.pl had compilation errors.

and the same apepars in the server logs. There is a scoping issue 
here but I can't see where it comes from.

Does anyone have any ideas?
Thanx,
Dp.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to