[29544] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 788 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 23 21:09:37 2007

Date: Thu, 23 Aug 2007 18:09:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 23 Aug 2007     Volume: 11 Number: 788

Today's topics:
        better hachage <john.swilting@wanadoo.fr>
    Re: Can I load a package's Autoload-able subs without e  w.c.humann@arcor.de
        Efficiently de-duping an array <dan.otterburn@gmail.com>
    Re: Efficiently de-duping an array <noreply@gunnar.cc>
        Is there a perl equivalent to the following.... <cdalten@gmail.com>
        ISO: What is the "best practice" for getting error info <lvirden@gmail.com>
    Re: ISO: What is the "best practice" for getting error  <jgibson@mail.arc.nasa.gov>
        New Perl Mongers Group: West Yorkshire, UK - Any intere <dan.otterburn@gmail.com>
        Script does not want to run in background ?!? <benoit.lefebvre@gmail.com>
    Re: Script does not want to run in background ?!? <bill@ts1000.us>
    Re: Script does not want to run in background ?!? <kevin@vaildc.net>
    Re: Starting with SOAP <scobloke2@infotop.co.uk>
    Re: Starting with SOAP <scobloke2@infotop.co.uk>
    Re: Starting with SOAP <perl4hire@softouch.on.ca>
    Re: Symrefs <stoupa@practisoft.cz>
    Re: Xah's Edu Corner: Under the spell of Leibniz's drea <twisted0n3@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 23 Aug 2007 23:17:54 +0200
From: "john.swilting" <john.swilting@wanadoo.fr>
Subject: better hachage
Message-Id: <46cdf983$0$25906$ba4acef3@news.orange.fr>

I know this type of writing.
which is the best style

#!/usr/bin/perl -w

use strict;
use warnings;

my %Conf = (
  XferMethod => "rsync",
  XferLogLevel => "1",
  RsyncShareName => "___1___",
  ClientNameAlias => "___2___"
  );




------------------------------

Date: Thu, 23 Aug 2007 14:35:38 -0700
From:  w.c.humann@arcor.de
Subject: Re: Can I load a package's Autoload-able subs without executing them?
Message-Id: <1187904938.399845.308210@i38g2000prf.googlegroups.com>

On 23 Aug., 16:13, Ben Morrow <b...@morrow.me.uk> wrote:
>
> >  <w.c.hum...@arcor.de> wrote in comp.lang.perl.misc:
> > > I want to be able to really load all subs in a given package,
> > > including all load-on-demand subs.
>
> One solution would be to have your tracer install a trace on AUTOLOAD as
> well, and handle it specially (noting the value of $AUTOLOAD, for
> instance; and probably trying to install a trace on the autoloaded sub,
> if it exists, after AUTOLOAD returns). Note that your problem here isn't
> strictly autoloading: it's the fact that Perl allows you to modify the
> symbol table at runtime. And there's no way around that: if a program
> randomly inserts a new sub into the symbol table, there's no way for you
> to find out.
>
That's a nice idea but with a few problems:
- It involves a lot of bookkeeping. I need to remember every category
of
  things that a user wanted to trace and see if a matching autoload
  comes around.
- It prevent me from notifying the user of misspelled function names.
If
  the user wants to trace "Tk::FocusNext" (which really should be
spelled
  "Tk::focusNext") I can't tell him there's no such function, cause it
  might be autoloaded any time...

(I might still give it a try...)

Wolfram



------------------------------

Date: 23 Aug 2007 23:49:18 GMT
From: Dan Otterburn <dan.otterburn@gmail.com>
Subject: Efficiently de-duping an array
Message-Id: <46ce1cfe$0$21097$da0feed9@news.zen.co.uk>

I have an array of a number of items, some of which are duplicates. I 
need to "de-dupe" the array, keeping the item with the lowest index.

  my @fruits = qw(
      apple
      apple
      pear
      banana
      pear
      apple
      banana
      plum
      plum
      apple
      plum
      peach
      kiwi
      pear
      plum
      banana
      cherry
      );

The "apple" I want is $fruits[0], the "pear" $fruits[2] etc...

My current solution is:

  my @fruits_deduped;
  while (my $fruit = pop @fruits) {
      next if grep { $_ eq $fruit } @fruits;
      push @fruits_deduped, $fruit;
  }
  @fruits = reverse @fruits_deduped;

This seems to be a lot of work, is there a better way to do this?

-- 
Dan Otterburn <dan.otterburn@gmail.com>


------------------------------

Date: Fri, 24 Aug 2007 02:42:03 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Efficiently de-duping an array
Message-Id: <5j6nr8F3t1pqlU1@mid.individual.net>

Dan Otterburn wrote:
> I have an array of a number of items, some of which are duplicates. I 
> need to "de-dupe" the array, keeping the item with the lowest index.

<snip>

> My current solution is:
> 
>   my @fruits_deduped;
>   while (my $fruit = pop @fruits) {
>       next if grep { $_ eq $fruit } @fruits;
>       push @fruits_deduped, $fruit;
>   }
>   @fruits = reverse @fruits_deduped;
> 
> This seems to be a lot of work, is there a better way to do this?

Use a hash.

     my ( @fruits_deduped, %seen );
     while ( my $fruit = shift @fruits ) {
         push @fruits_deduped, $fruit unless $seen{$fruit}++;
     }

See also "perldoc -q duplicate".

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Thu, 23 Aug 2007 18:06:45 -0700
From:  grocery_stocker <cdalten@gmail.com>
Subject: Is there a perl equivalent to the following....
Message-Id: <1187917605.364131.18120@l22g2000prc.googlegroups.com>

Is there a perl equivalent to the java 'this' keyword ?

Chad



------------------------------

Date: Thu, 23 Aug 2007 12:50:56 -0700
From:  "Larry W. Virden" <lvirden@gmail.com>
Subject: ISO: What is the "best practice" for getting error info from a pipeline?
Message-Id: <1187898656.403733.308310@m37g2000prh.googlegroups.com>

Background:

On a scale of 0 to 10, where a person at 0 says "what's a programming
language" and a 10 is Larry Wall, I would rate myself a 2 or maybe a 3
in relationship to perl.

I provide maintenance support on a huge number of programs, written in
a dozen or so languages. I don't do much original programming, so
there is little practice.

In the thousands of files that I support is a rather largish (in the
200+k lines of code range) system that deals with installation
metadata (where does item version 1.2 get installed, with what
permissions, what mode, etc. - that kind of metadata).

Within this code is some perl code that does basically this sort of
thing:

            # Email request
            my $send = IO::Pipe->new();
            my $arch = `/bin/arch`;
            chomp $arch;
            $send->writer("/path/bin/$arch/psend", 'REQUEST');
            my $a = $self->{'queue'};
            for (my $indx = 0; $indx < @{$a}; $indx++) {
                my $r = $a->[$indx];
                $send->print(":$r->[0]");
                for (my $args = 1; $args < @{$r}; $args++) {
                    (my $arg = $r->[$args]) =~ s!([\\"])!\\$1!g;
                    $send->print(',"', $arg, '"');
                }
                $send->print("\n");
            }
            if ($send->close()) {
                my $msg = @{$a};
                delete $self->{'queue'};
                $self->{'queue'} = [ $sys ];
                return "$msg steps submitted";
            }
            $self->error('error: psend failed');
            return undef;

The problem is that psend turns out to possibly exit with a non-zero
exit code if it has problems, and this calling program doesn't appear
to notice the fact that psend has failed.

So I have been asked to update it to :

a. recognize that the program at the end of the IO::Pipe has failed
and to exit with an error msg
b. pass any stderr messages back as part of the psend failed error
message, so that the user has some chance of fixing the problem.

In reading the IO::Pipe and IO::Handle docs, I don't see a lot of
detail about handling the remote program's error "exits".

Does anyone have suggestions on what needs to happen? For instance,
the info in IO::Handle mentions $self->error, but says that it is a
boolean indicator; that doesn't seem like it is going to help me with
accessing the error messages theirselves. I suppose the specific exit
code won't be as big a deal as long as the error messages are unique.

Anyways, I'd love any pointers, etc. that you might have. I did google
for some things and tried to solve this, but failed to turn up
anything that looked remotely useful.



------------------------------

Date: Thu, 23 Aug 2007 15:28:14 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: ISO: What is the "best practice" for getting error info from a pipeline?
Message-Id: <230820071528144185%jgibson@mail.arc.nasa.gov>

In article <1187898656.403733.308310@m37g2000prh.googlegroups.com>,
Larry W. Virden <lvirden@gmail.com> wrote:

> Background:
> 
> On a scale of 0 to 10, where a person at 0 says "what's a programming
> language" and a 10 is Larry Wall, I would rate myself a 2 or maybe a 3
> in relationship to perl.
> 
> I provide maintenance support on a huge number of programs, written in
> a dozen or so languages. I don't do much original programming, so
> there is little practice.
> 
> In the thousands of files that I support is a rather largish (in the
> 200+k lines of code range) system that deals with installation
> metadata (where does item version 1.2 get installed, with what
> permissions, what mode, etc. - that kind of metadata).
> 
> Within this code is some perl code that does basically this sort of
> thing:
> 
>             # Email request
>             my $send = IO::Pipe->new();
>             my $arch = `/bin/arch`;
>             chomp $arch;
>             $send->writer("/path/bin/$arch/psend", 'REQUEST');
>             my $a = $self->{'queue'};
>             for (my $indx = 0; $indx < @{$a}; $indx++) {
>                 my $r = $a->[$indx];
>                 $send->print(":$r->[0]");
>                 for (my $args = 1; $args < @{$r}; $args++) {
>                     (my $arg = $r->[$args]) =~ s!([\\"])!\\$1!g;
>                     $send->print(',"', $arg, '"');
>                 }
>                 $send->print("\n");
>             }
>             if ($send->close()) {
>                 my $msg = @{$a};
>                 delete $self->{'queue'};
>                 $self->{'queue'} = [ $sys ];
>                 return "$msg steps submitted";
>             }
>             $self->error('error: psend failed');
>             return undef;
> 
> The problem is that psend turns out to possibly exit with a non-zero
> exit code if it has problems, and this calling program doesn't appear
> to notice the fact that psend has failed.

IO::Handle::close calls close() on the pipe and returns the value
returned by close(). From 'perldoc close':

"If the file handle came from a piped open, "close" will addi-
tionally return false if one of the other system calls involved
fails, or if the program exits with non-zero status.  (If the
only problem was that the program exited non-zero, $! will be
set to 0.)  Closing a pipe also waits for the process executing
on the pipe to complete, in case you want to look at the output
of the pipe afterwards, and implicitly puts the exit status
value of that command into $?."

So this program is already checking for the error return from close().
There may not be much more that you can do except check the values of
$! and $? if close returns an error.

-- 
Jim Gibson

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


------------------------------

Date: 24 Aug 2007 00:08:16 GMT
From: Dan Otterburn <dan.otterburn@gmail.com>
Subject: New Perl Mongers Group: West Yorkshire, UK - Any interest?
Message-Id: <46ce2170$0$13935$fa0fcedb@news.zen.co.uk>

I would like to start a Perl Mongers group in West Yorkshire and am 
canvassing for any interested parties...

If you are into Perl and based in the West Yorkshire area (I live in 
Haworth, work in Halifax) please let me know. (I'm willing to do the leg 
work for the group, just need some attendees!)

-- 
Dan Otterburn <dan.otterburn@gmail.com>


------------------------------

Date: Thu, 23 Aug 2007 13:28:24 -0700
From:  Benoit Lefebvre <benoit.lefebvre@gmail.com>
Subject: Script does not want to run in background ?!?
Message-Id: <1187900904.014278.248140@l22g2000prc.googlegroups.com>

I made a little script that ssh to many servers (IBM HMCs) to get a
list of all logical partitions on some pSeries servers managed by the
HMCs

Here is the complete script: (It's called getlpars.pl)
-----------------------------------------------------------------------------------------------------------
#!/usr/bin/perl

chomp(@hmclist = `cat ~/scripts/conf/hmc.list`);

foreach (@hmclist) {
  my($hmc,$hmctype) = split(":",$_);

  if ($hmctype eq "p4") {

    chomp(@list = `ssh -q hscroot\@$hmc 'lssyscfg -r sys --all'`);

    @managedsystems = ();

    for ($i = 1; $i <= scalar @list -1; $i++) {
      $system = substr($list[$i],0,16);
      $system =~ s/\s*$//g;
      push(@managedsystems, $system);
    }

    foreach (@managedsystems) {
      $system = $_;
      $system = "\"".$system."\"";

      chomp(@list = `ssh -q hscroot\@$hmc 'lssyscfg -m $system -r lpar
--all'`);

      for ($i = 2; $i <= scalar @list -1; $i++) {
        $lpar = substr($list[$i],0,20);
        $lpar =~ s/\s*$//g;
        print $hmc .":". $system .":". $lpar . "\n";
      }
    }
  } elsif ($hmctype eq "p5") {
    @list = `ssh -q hscroot\@$hmc 'lssyscfg -r sys'`;

    @managedsystems = ();

    foreach (@list) {
      @ln = split(",", $_);
      push(@managedsystems, substr($ln[0],5,length($ln[0])));
    }

    foreach (@managedsystems) {
      $system = $_;
      $system =~ s/\s/\\ /g;
      @list2 = `ssh -q hscroot\@$hmc 'lssyscfg -r lpar -m $system -F --
header`;
      foreach (@list2) {
        @ln2 = split(",", $_);
        print $hmc .":". $system .":". $ln2[0] . "\n";
      }
    }
  }
}
-----------------------------------------------------------------------------------------------------------

~/scripts/conf/hmc.list contains a list of all HMCs with they type (p4
or p5) delemited with ":"

Content of hmc.list
-----------------------------------------------------------------------------------------------------------
name_of_hmc:p4
name_of_hmc2:p5
-----------------------------------------------------------------------------------------------------------

Here is the "problem"

When I execute the script manually from the shell I get the outputs I
want.

When I run it from the crontab or in background "&" it fails.

[user@server (~/scripts/scripts)]: ./getlpars.pl &
[2]     467196
[2] + Stopped (SIGTTIN)        ./getlpars.pl &

Is there any way to get more details on the error.. why it's
stopping ?

Thanks,
  --Benoit Lefebvre
    benoit.lefebvre@gmail.com



------------------------------

Date: Thu, 23 Aug 2007 14:10:21 -0700
From:  Bill H <bill@ts1000.us>
Subject: Re: Script does not want to run in background ?!?
Message-Id: <1187903421.024703.172200@z24g2000prh.googlegroups.com>

On Aug 23, 4:28 pm, Benoit Lefebvre <benoit.lefeb...@gmail.com> wrote:
> I made a little script that ssh to many servers (IBM HMCs) to get a
> list of all logical partitions on some pSeries servers managed by the
> HMCs
>
> Here is the complete script: (It's called getlpars.pl)
> -------------------------------------------------------------------------=
--=AD--------------------------------
> #!/usr/bin/perl
>
> chomp(@hmclist =3D `cat ~/scripts/conf/hmc.list`);
>
> foreach (@hmclist) {
>   my($hmc,$hmctype) =3D split(":",$_);
>
>   if ($hmctype eq "p4") {
>
>     chomp(@list =3D `ssh -q hscroot\@$hmc 'lssyscfg -r sys --all'`);
>
>     @managedsystems =3D ();
>
>     for ($i =3D 1; $i <=3D scalar @list -1; $i++) {
>       $system =3D substr($list[$i],0,16);
>       $system =3D~ s/\s*$//g;
>       push(@managedsystems, $system);
>     }
>
>     foreach (@managedsystems) {
>       $system =3D $_;
>       $system =3D "\"".$system."\"";
>
>       chomp(@list =3D `ssh -q hscroot\@$hmc 'lssyscfg -m $system -r lpar
> --all'`);
>
>       for ($i =3D 2; $i <=3D scalar @list -1; $i++) {
>         $lpar =3D substr($list[$i],0,20);
>         $lpar =3D~ s/\s*$//g;
>         print $hmc .":". $system .":". $lpar . "\n";
>       }
>     }
>   } elsif ($hmctype eq "p5") {
>     @list =3D `ssh -q hscroot\@$hmc 'lssyscfg -r sys'`;
>
>     @managedsystems =3D ();
>
>     foreach (@list) {
>       @ln =3D split(",", $_);
>       push(@managedsystems, substr($ln[0],5,length($ln[0])));
>     }
>
>     foreach (@managedsystems) {
>       $system =3D $_;
>       $system =3D~ s/\s/\\ /g;
>       @list2 =3D `ssh -q hscroot\@$hmc 'lssyscfg -r lpar -m $system -F --
> header`;
>       foreach (@list2) {
>         @ln2 =3D split(",", $_);
>         print $hmc .":". $system .":". $ln2[0] . "\n";
>       }
>     }
>   }}
>
> -------------------------------------------------------------------------=
--=AD--------------------------------
>
> ~/scripts/conf/hmc.list contains a list of all HMCs with they type (p4
> or p5) delemited with ":"
>
> Content of hmc.list
> -------------------------------------------------------------------------=
--=AD--------------------------------
> name_of_hmc:p4
> name_of_hmc2:p5
> -------------------------------------------------------------------------=
--=AD--------------------------------
>
> Here is the "problem"
>
> When I execute the script manually from the shell I get the outputs I
> want.
>
> When I run it from the crontab or in background "&" it fails.
>
> [user@server (~/scripts/scripts)]: ./getlpars.pl &
> [2]     467196
> [2] + Stopped (SIGTTIN)        ./getlpars.pl &
>
> Is there any way to get more details on the error.. why it's
> stopping ?
>
> Thanks,
>   --Benoit Lefebvre
>     benoit.lefeb...@gmail.com

Could it be a permissions issue? I had a similar issue with a program
that ran fine on a server from the telnet prompt, but wouldnt in a
cronjob. Worked out I had to "chown" it so it would execute in the
cron job.

Bill H



------------------------------

Date: Fri, 24 Aug 2007 00:17:37 GMT
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: Script does not want to run in background ?!?
Message-Id: <kevin-6A4F44.20173623082007@news.verizon.net>

In article <1187900904.014278.248140@l22g2000prc.googlegroups.com>,
 Benoit Lefebvre <benoit.lefebvre@gmail.com> wrote:

[]

> When I execute the script manually from the shell I get the outputs I
> want.
> 
> When I run it from the crontab or in background "&" it fails.
> 
> [user@server (~/scripts/scripts)]: ./getlpars.pl &
> [2]     467196
> [2] + Stopped (SIGTTIN)        ./getlpars.pl &
> 
> Is there any way to get more details on the error.. why it's
> stopping ?

SIGTTIN means it tried to read from the input TTY, which is not 
permitted from a background job (you could bring it to the foreground, 
though) or from cron.  I have no idea what it's reading, unless 'ssh' is 
looking for something.
-- 
Kevin Michael Vail | a billion stars go spinning through the night,
kevin@vaildc.net   | blazing high above your head.
 . . . . . . . . . | But _in_ you is the presence that
  . . . . . . . .  | will be, when all the stars are dead.
 . . . . . . . . . |     (Rainer Maria Rilke)



------------------------------

Date: Thu, 23 Aug 2007 19:44:45 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Starting with SOAP
Message-Id: <uqCdndA1i4kBSFDbnZ2dneKdnZylnZ2d@bt.com>

xhoster@gmail.com wrote:
> Ian Wilson <scobloke2@infotop.co.uk> wrote:
>>
>> Just use SOAP::Lite.
> 
> What did you have to do to get this to work?  

Almost nothing. SOAP::Lite (and associated modules) were already 
installed on all my Unix servers - it seems to be part of their standard 
  operating system installation.

On Windows XP, I installed ActiveState ActivePerl 5.8.0. I recall I had 
problems with finding SOAP::Lite for earlier versions but I'm pretty 
sure it was straightforward for 5.8.0. I used the command line package 
manager `ppm` - I wasn't aware of a GUI package manager.

> What version of SOAP::Lite do you use? 

C:\>ppm
PPM - Programmer's Package Manager version 3.1.
Copyright (c) 2001 ActiveState SRL. All Rights Reserved.

Entering interactive shell. Using Term::ReadLine::Stub as readline library.

Type 'help' to get started.

ppm> query soap
Querying target 1 (ActivePerl 5.8.0.806)
   1. SOAP-Lite    [0.55] Library for Simple Object Access Protocol 
(SOAP) clie~


> When I point SOAP::Lite at a .net WSDL, it just dies from
> internal errors.

It may depend on the particular web-service. Can you get a basic 
SOAP::Lite client and server working?

I have Apache installed on my Windows XP computers since the target 
environment for which I develop is Apache.

In Apache's cgi-bin directory I put service.pl
-----------------------------8<--------------------------------
#!perl
use strict;
use warnings;
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI
   -> dispatch_to('C:/path/to/cgi-bin/SoapModules')
   -> handle;
-----------------------------8<--------------------------------

In a subfolder cgi-bin\SoapModules I have Temperature.pm
-----------------------------8<--------------------------------
package Temperature;
sub c2f {
     my ($class, $c) = @_;
     return 32+$c*9/5;
}
1;
-----------------------------8<--------------------------------

Elsewhere I have a client tempclient.pl
-----------------------------8<--------------------------------
#!perl
use strict;
use warnings;
use SOAP::Lite;

my $temperature=SOAP::Lite
   -> uri('Temperature')
   -> proxy('http://localhost/cgi-bin/service.pl');

print $temperature
   -> c2f(37.5)
   -> result;
-----------------------------8<--------------------------------

C:> perl tempclient.pl
99.5
C:>


There's crawling, walking and running stages of learning SOAP::Lite. The 
above constitutes crawling. I find it useful to make sure I can crawl 
before attempting more advanced forms of locomotion.



------------------------------

Date: Thu, 23 Aug 2007 20:29:01 +0100
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: Starting with SOAP
Message-Id: <1u2dnUpByNRgQlDbnZ2dnUVZ8ternZ2d@bt.com>

Amer Neely wrote:
> Ian Wilson wrote:
> 
>> These commands should all return without any error messages
>> $ perl -MSOAP::Lite -e1
> 
>> $ perl -MSOAP::Transport::HTTP -e1
> 
>> $ perl -MSOAP::Transport::HTTP::CGI -e
> No code specified for -e.
> 
> ... so I figured you forgot the '1' ...

Oops yes :-)

> 
> Can't locate SOAP/Transport/HTTP/CGI.pm in @INC (@INC contains: 
> C:/usr/site/lib
> C:/usr/lib .).
> BEGIN failed--compilation aborted.
> 
> This is on my home PC, which is acting as the 'client'.

The commands I gave work on Unix, The modules seem to be packaged 
differently by ActiveState for Windows. Maybe its a difference between 
SOAP::Lite versions 0.55 and 0.65. Even though there's no CGI.pm on 
Windows, you can still refer to SOAP::Transport::HTTP::CGI in your Perl 
programs.

> 
> So it appears my installation is flawed. I will re-install.
> 

Bear in mind that I use Apache on Windows to test CGI based 
web-services. If you are using the standalone HTTP daemon, that's 
something I haven't tried yet.

<later>

Just tried a standalone demon - its fine too

------------------------------8<---------------------------------
#!perl -w

use SOAP::Transport::HTTP;

#use Demo;

# don't want to die on 'Broken pipe' or Ctrl-C
$SIG{PIPE} = $SIG{INT} = 'IGNORE';

my $daemon = SOAP::Transport::HTTP::Daemon
   -> new (LocalPort => 8081)
   -> dispatch_to('C:/path/to/cgi-bin/SoapModules')
;

print "Contact to SOAP server at ", $daemon->url, "\n";
$daemon->handle;
------------------------------8<---------------------------------
#!perl
use strict;
use warnings;

use SOAP::Lite;

my $temperature=SOAP::Lite
   -> uri('Temperature')
   -> proxy('http://localhost:8081');

print $temperature
   -> c2f(37.5)
   -> result;
------------------------------8<---------------------------------

Temperature.pm in SoapModules is as in my other post.

In one Command Prompt window ...
C:> perl TempServer.pl
Contact to SOAP server at http://pcname:8081/

In a different Command Prompt window ...
C:> perl tempclient2.pl
99.5
C:>


------------------------------

Date: Thu, 23 Aug 2007 17:35:43 -0400
From: Amer Neely <perl4hire@softouch.on.ca>
Subject: Re: Starting with SOAP
Message-Id: <h3nzi.625$tx1.147@read1.cgocable.net>

Ian Wilson wrote:

> Somewhere in one of the directories listed in @INC you should have
> SOAP/Lite.pm
> SOAP/Transport/HTTP.pm
> SOAP/Transport/HTTP/CGI.pm
> (and many other related modules)

I've re-installed SOAP-Lite from AS using ppm 4.01 GUI (actually 
upgraded it to .69).

But I notice that I now have what seems to be 2 versions of it - one 
under /usr/lib and one under /usr/site/lib

SOAP-Lite
Interface to the Simple Object Access Protocol (SOAP)
	Version:	0.55-r1
	Released:	2005-07-19
	Author:	Paul Kulchenko <paulclinger@yahoo.com>
	CPAN:	http://search.cpan.org/dist/SOAP-Lite-0.55/

Installed files:
	C:/usr/bin/SOAPsh.bat
	C:/usr/bin/SOAPsh.pl
	C:/usr/bin/XMLRPCsh.bat
	C:/usr/bin/XMLRPCsh.pl
	C:/usr/bin/stubmaker.bat
	C:/usr/bin/stubmaker.pl
	C:/usr/lib/Apache/SOAP.pm
	C:/usr/lib/Apache/XMLRPC/Lite.pm
	C:/usr/lib/IO/SessionData.pm
	C:/usr/lib/IO/SessionSet.pm
	C:/usr/lib/SOAP/Lite.pm
	C:/usr/lib/SOAP/Test.pm
	C:/usr/lib/SOAP/Transport/FTP.pm
	C:/usr/lib/SOAP/Transport/HTTP.pm
	C:/usr/lib/SOAP/Transport/IO.pm
	C:/usr/lib/SOAP/Transport/JABBER.pm
	C:/usr/lib/SOAP/Transport/LOCAL.pm
	C:/usr/lib/SOAP/Transport/MAILTO.pm
	C:/usr/lib/SOAP/Transport/MQ.pm
	C:/usr/lib/SOAP/Transport/POP3.pm
	C:/usr/lib/SOAP/Transport/TCP.pm
	C:/usr/lib/UDDI/Lite.pm
	C:/usr/lib/XML/Parser/Lite.pm
	C:/usr/lib/XMLRPC/Lite.pm
	C:/usr/lib/XMLRPC/Test.pm
	C:/usr/lib/XMLRPC/Transport/HTTP.pm
	C:/usr/lib/XMLRPC/Transport/POP3.pm
	C:/usr/lib/XMLRPC/Transport/TCP.pm
	C:/usr/lib/auto/SOAP/Lite/.packlist


SOAP-Lite
Perl's Web Services Toolkit
	Version:	0.69
	Author:	Byrne Reese <byrne@cpan.org>
	CPAN:	http://search.cpan.org/dist/SOAP-Lite-0.69/

Installed files:
	C:/usr/html/bin/SOAPsh.html
	C:/usr/html/bin/XMLRPCsh.html
	C:/usr/html/bin/stubmaker.html
	C:/usr/html/site/lib/Apache/SOAP.html
	C:/usr/html/site/lib/Apache/XMLRPC/Lite.html
	C:/usr/html/site/lib/OldDocs/SOAP/Lite.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/FTP.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/HTTP.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/IO.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/JABBER.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/LOCAL.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/MAILTO.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/MQ.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/POP3.html
	C:/usr/html/site/lib/OldDocs/SOAP/Transport/TCP.html
	C:/usr/html/site/lib/SOAP/Client.html
	C:/usr/html/site/lib/SOAP/Constants.html
	C:/usr/html/site/lib/SOAP/Data.html
	C:/usr/html/site/lib/SOAP/Deserializer.html
	C:/usr/html/site/lib/SOAP/Fault.html
	C:/usr/html/site/lib/SOAP/Header.html
	C:/usr/html/site/lib/SOAP/Lite.html
	C:/usr/html/site/lib/SOAP/Packager.html
	C:/usr/html/site/lib/SOAP/SOM.html
	C:/usr/html/site/lib/SOAP/Schema.html
	C:/usr/html/site/lib/SOAP/Serializer.html
	C:/usr/html/site/lib/SOAP/Server.html
	C:/usr/html/site/lib/SOAP/Test.html
	C:/usr/html/site/lib/SOAP/Trace.html
	C:/usr/html/site/lib/SOAP/Transport.html
	C:/usr/html/site/lib/SOAP/Transport/POP3.html
	C:/usr/html/site/lib/SOAP/Utils.html
	C:/usr/html/site/lib/UDDI/Lite.html
	C:/usr/html/site/lib/XML/Parser/Lite.html
	C:/usr/html/site/lib/XMLRPC/Lite.html
	C:/usr/html/site/lib/XMLRPC/Test.html
	C:/usr/html/site/lib/XMLRPC/Transport/HTTP.html
	C:/usr/html/site/lib/XMLRPC/Transport/POP3.html
	C:/usr/html/site/lib/XMLRPC/Transport/TCP.html
	C:/usr/site/bin/SOAPsh.bat
	C:/usr/site/bin/SOAPsh.pl
	C:/usr/site/bin/XMLRPCsh.bat
	C:/usr/site/bin/XMLRPCsh.pl
	C:/usr/site/bin/stubmaker.bat
	C:/usr/site/bin/stubmaker.pl
	C:/usr/site/lib/Apache/SOAP.pm
	C:/usr/site/lib/Apache/XMLRPC/Lite.pm
	C:/usr/site/lib/IO/SessionData.pm
	C:/usr/site/lib/IO/SessionSet.pm
	C:/usr/site/lib/OldDocs/SOAP/Lite.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/FTP.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/HTTP.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/IO.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/JABBER.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/LOCAL.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/MAILTO.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/MQ.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/POP3.pm
	C:/usr/site/lib/OldDocs/SOAP/Transport/TCP.pm
	C:/usr/site/lib/SOAP/Client.pm
	C:/usr/site/lib/SOAP/Constants.pm
	C:/usr/site/lib/SOAP/Data.pm
	C:/usr/site/lib/SOAP/Deserializer.pm
	C:/usr/site/lib/SOAP/Fault.pm
	C:/usr/site/lib/SOAP/Header.pm
	C:/usr/site/lib/SOAP/Lite.pm
	C:/usr/site/lib/SOAP/Packager.pm
	C:/usr/site/lib/SOAP/SOM.pm
	C:/usr/site/lib/SOAP/Schema.pm
	C:/usr/site/lib/SOAP/Serializer.pm
	C:/usr/site/lib/SOAP/Server.pm
	C:/usr/site/lib/SOAP/Test.pm
	C:/usr/site/lib/SOAP/Trace.pm
	C:/usr/site/lib/SOAP/Transport.pm
	C:/usr/site/lib/SOAP/Transport/FTP.pm
	C:/usr/site/lib/SOAP/Transport/HTTP.pm
	C:/usr/site/lib/SOAP/Transport/IO.pm
	C:/usr/site/lib/SOAP/Transport/JABBER.pm
	C:/usr/site/lib/SOAP/Transport/LOCAL.pm
	C:/usr/site/lib/SOAP/Transport/MAILTO.pm
	C:/usr/site/lib/SOAP/Transport/MQ.pm
	C:/usr/site/lib/SOAP/Transport/POP3.pm
	C:/usr/site/lib/SOAP/Transport/TCP.pm
	C:/usr/site/lib/SOAP/Utils.pm
	C:/usr/site/lib/UDDI/Lite.pm
	C:/usr/site/lib/XML/Parser/Lite.pm
	C:/usr/site/lib/XMLRPC/Lite.pm
	C:/usr/site/lib/XMLRPC/Test.pm
	C:/usr/site/lib/XMLRPC/Transport/HTTP.pm
	C:/usr/site/lib/XMLRPC/Transport/POP3.pm
	C:/usr/site/lib/XMLRPC/Transport/TCP.pm
	C:/usr/site/lib/auto/SOAP/Lite/.packlist

However, PPM will not let me delete the older version.

Could this be why I may be having some difficulties?
-- 
Amer Neely
w: www.webmechanic.softouch.on.ca/
Perl | MySQL programming for all data entry forms.
"Others make web sites. We make web sites work!"


------------------------------

Date: Thu, 23 Aug 2007 18:42:03 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: Symrefs
Message-Id: <fakr87$2k32$1@ns.felk.cvut.cz>

Ben Morrow wrote:
> Quoth "Petr Vileta" <stoupa@practisoft.cz>:
>>
> I don't understand why your subs need to be in a symbol table at all.
> Why can't you just store them directly in the dispatch table? Then you
> don't need to worry about quoting the names.
>
> my %dispatch = (
>
>    'www.france.weather.fr' => sub { ... },
>

Because:

my %dispatch = (
    'www.france-weather.fr' =>sub {100 - 500 lines of code}
 ...
:-)

-- 

Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail 
from another non-spammer site please.)





------------------------------

Date: Thu, 23 Aug 2007 22:30:58 -0000
From:  Twisted <twisted0n3@gmail.com>
Subject: Re: Xah's Edu Corner: Under the spell of Leibniz's dream
Message-Id: <1187908258.609624.321990@m37g2000prh.googlegroups.com>

On Aug 23, 3:38 am, Matthias Buelow <m...@incubus.de> wrote:
> In comp.lang.lisp Bikal KC <nepbabucxspamf...@yahoo.ca> wrote:
>
> > I used usenet years ago then stopped for couple of years. I remember
> > seeing him/her on c.l.perl I believe doing the same thing he/she is
> > doing atm. I'd say the ultimate usenet superstar. Wow!
>
> I think it's some (probably mild) form of autism.
> No offense intended, Xah.

Yeah, yeah, that's what they all say, especially when they do that
most-common of usenet things -- insult your mental health and tone it
as if it were a very compassionate and understanding suggestion to
seek medical treatment rather than the flame that it is. :P



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 788
**************************************


home help back first fref pref prev next nref lref last post