#!c:\perl\bin\perl.exe use strict; use warnings; use SOAP::Transport::HTTP; use CGI; use Carp; SOAP::Transport::HTTP::CGI ->dispatch_to('emailfind') ->handle; my $cgi = new CGI; package emailfind; sub findingit { my $cgi = shift; #croak "Error: cgi object not passed" if(!$cgi); my $cookie = $cgi->cookie('WALOGIN'); return if (!$cookie || $cookie eq 'RESET'); #exit function if cookie empty or is RESET my ($e) = split(/-/, $cookie); my $email= pack("H*",$e); # decode email address return $email; } #### #!c:\perl\bin\perl.exe use warnings; use SOAP::Lite; my $soap = SOAP::Lite ->uri('http://localhost/emailfind') ->proxy('http://localhost/cgi-bin/soapdish.pl'); unless ($soap->fault) { print $soap->findingit(); } else { print join ', ', $soap->faultcode, $soap->faultstring, $soap->faultdetail; }