diff -Naur pilot-link.0.9.5-orig/tools/Perl5/Makefile.PL.in pilot-link.0.9.5/tools/Perl5/Makefile.PL.in
--- pilot-link.0.9.5-orig/tools/Perl5/Makefile.PL.in	Wed Jun  6 09:16:58 2001
+++ pilot-link.0.9.5/tools/Perl5/Makefile.PL.in	Sun May 12 23:20:36 2002
@@ -5,17 +5,12 @@
 $prefix = "@prefix@";
 $exec_prefix = "@exec_prefix@";
 $libdir = "@libdir@";
-
-unless ((-e "$libdir/libpisock.la") or (-e "$libdir/libpisock.a")) {
-	die "pilot-link must be installed before PDA::Pilot can be built\n";
-}
-
-$lib = "-L$libdir -lpisock";
+$lib = "-L../../libsock/.libs -lpisock";
 
 WriteMakefile(
     'NAME'       => 'PDA::Pilot',
     'VERSION'    => '0.1',
-    'LIBS'       => $lib,
+    'LDFROM'       => "Pilot.o $lib",
     'XSPROTOARG' => '-noprototypes',
     'INC'        => '-I../../include',
     'DEFINE'     => '-DPERL_POLLUTE',
diff -Naur pilot-link.0.9.5-orig/tools/Perl5/Pilot.pm pilot-link.0.9.5/tools/Perl5/Pilot.pm
--- pilot-link.0.9.5-orig/tools/Perl5/Pilot.pm	Wed Jun  6 09:16:58 2001
+++ pilot-link.0.9.5/tools/Perl5/Pilot.pm	Sun May 12 23:20:36 2002
@@ -756,8 +756,16 @@
 
 Returns last DLP error, resetting error to zero.
 
+=item PDA::Pilot::DLP::socket()
+
+Returns DLP socket.
+
 =item PDA::Pilot::DLP::GetSysDateTime(socket)
 
+=item PDA::Pilot::DLP::socket()
+
+Returns the socket in use by DLP.
+
 Same as DLP call dlp_GetSysDateTime. If successfull, returns time, otherwise
 returns undef.
 
diff -Naur pilot-link.0.9.5-orig/tools/Perl5/Pilot.xs pilot-link.0.9.5/tools/Perl5/Pilot.xs
--- pilot-link.0.9.5-orig/tools/Perl5/Pilot.xs	Wed Jun  6 09:16:58 2001
+++ pilot-link.0.9.5/tools/Perl5/Pilot.xs	Sun May 12 23:20:36 2002
@@ -23,6 +23,10 @@
 #include "XSUB.h"
 #include "patchlevel.h"
 
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <netinet/tcp.h>
+
 #include "pi-macros.h"
 #include "pi-file.h"
 #include "pi-datebook.h"
@@ -2268,7 +2272,7 @@
 	    if (len > sizeof(mybuf))
 	    	len = sizeof(mybuf);
 	    result = pi_read(socket, mybuf, len);
-	    if (result >=0) 
+	    if (result > 0) 
 	    	RETVAL = newSVpv(mybuf, result);
 	    else
 	    	RETVAL = &sv_undef;
@@ -2351,6 +2355,26 @@
 	OUTPUT:
 	RETVAL
 
+int
+connect(port)
+	char *	port
+	CODE:
+	{
+		struct pi_sockaddr a;
+		int socket;
+		
+		socket = pi_socket(PI_AF_SLP, PI_SOCK_STREAM, PI_PF_PADP);
+		strcpy(a.pi_device, port);
+		a.pi_family = PI_AF_SLP;
+		
+	    if (pi_connect(socket, (struct sockaddr*)&a, sizeof(a)))
+	    	RETVAL = 0;
+		else
+			RETVAL = socket;
+	}
+	OUTPUT:
+	RETVAL
+
 SV *
 accept(socket)
 	int	socket
@@ -3018,6 +3042,15 @@
 	OUTPUT:
 	RETVAL
 
+int
+socket(self)
+	PDA::Pilot::DLP *	self
+	CODE:
+		RETVAL = self->socket;
+	OUTPUT:
+	RETVAL
+
+
 SV *
 getTime(self)
 	PDA::Pilot::DLP *	self

