SOAP: The Power Of Simplicity 
O'Reilly P2P Conference 2001
<<< 19/52 >>>
Copyright (C) 2001 Paul Kulchenko, Tony Hong

SOAP::Lite, Basic concepts: Server for object access

  
  use SOAP::Transport::HTTP;
  SOAP::Transport::HTTP::CGI
    -> dispatch_to('Temperatures')
    -> handle;
  package Temperatures;
  sub new {
      my $self = shift;
      my $class = ref($self) || $self;
      bless {_temperature => shift} => $class;
  }
  sub as_fahrenheit {
      return shift->{_temperature};
  }
  sub as_celsius {
      return 5/9*(shift->{_temperature}-32);
  }

Create your own class and give access to it with dispatch_to() method. No less, no more.