#!/usr/bin/perl
use SOAP::Transport::HTTP;
SOAP::Transport::HTTP::CGI->dispatch_to('Object')->handle;
package Object;
sub new {
my $class = shift;
$class = ref($class) || $class;
return bless { '_cache' => [] }, $class;
}
sub set {
my ( $self, $arg ) = @_;
$self->{'_field'} = $arg;
push @{ $self->{'_cache'} }, $arg;
}
sub get { shift->{'_field'} }
sub all { shift->{'_cache' } }
####
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite
+autodispatch =>
uri => 'http://www.perlmonks.org/Object',
proxy => 'http://localhost/cgi-bin/soap.pl';
my $obj = Object->new();
for ( qw'So how is it possible that it stores and returns these? ???' ) {
$obj->set( $_ );
print $obj->get, "\n";
}
print join ' ', @{ $obj->all };
##
##
So
how
is
it
possible
that
it
stores
and
returns
these?
???
So how is it possible that it stores and returns these? ???