beginner question on use of Frontier::Client

I'm attempting to write one of my first perl programs. It is to
interact with an internal web service. I'm having something basic going
wrong:

use Frontier::Client ;

# Parameter:
# login_id
#
# Output:
# login_id of manager

my [at] supervisor_info;
$server = Frontier::Client->new('url' => 'http://server:port/' );

foreach my $empno ( [at] ARGV) {
[at] supervisor_info = Frontier::Client->call('GetAllInfoByEmpNo',
$empno);
if ( $#supervisor_info != 0 ) {
print "found $empno\n";
} else {
print "Unable to locate supervisor for $empno\n";
} ;
}

As you can see, I'm not trying to do anything with the data yet - in
fact, not even looking at the data yet. Just trying to get the basic
skeleton working, so that I know, moving on, that the basics are
working.

Of course, I have a real server and port URL in the new call.
And the method name comes from the documentation that the web service
guys have provided.

The error I get is:
Can't use string ("Frontier::Client") as a HASH ref while "strict refs"
in use at /usr/local/perl5/lib/site_perl/5.8.4/Frontier/Client.pm line
53.

(where that is the path to the pm file).

I appear to be missing something obvious. Given that I have not written
many perl programs, it is probably something embarassingly simple.

I was wondering if anyone could provide me a kind nudge in the right
direction?

Thanks!
lvirden [ Mi, 15 November 2006 16:52 ] [ ID #1537304 ]

Re: beginner question on use of Frontier::Client

lvirden wrote:
> I'm attempting to write one of my first perl programs. It is to
> interact with an internal web service. I'm having something basic going
> wrong:
>
> use Frontier::Client ;
>
> # Parameter:
> # login_id
> #
> # Output:
> # login_id of manager
>
> my [at] supervisor_info;
> $server = Frontier::Client->new('url' => 'http://server:port/' );
>
> foreach my $empno ( [at] ARGV) {
> [at] supervisor_info = Frontier::Client->call('GetAllInfoByEmpNo',
> $empno);

That should be
[at] supervisor_info = $server->call(...
as call() is an object method.

-Chris
Christian Winter [ Mi, 15 November 2006 17:01 ] [ ID #1537305 ]

Re: beginner question on use of Frontier::Client

Christian Winter wrote:
> That should be
> [at] supervisor_info = $server->call(...
> as call() is an object method.

:blush: I can't believe that I missed that one. I apologize for such a
novice mistake... but then, I am a novice. I don't "think" in Perl yet,
so I'm doing a lot of googling and thumbing through books.

I appreciate your patience.
lvirden [ Mi, 15 November 2006 17:48 ] [ ID #1537306 ]
Perl » comp.lang.perl.modules » beginner question on use of Frontier::Client

Vorheriges Thema: Creating spokes with SVG::TT::Graph::Pie
Nächstes Thema: Appropriate Namespace for a PBKDF1 implementation?