i have this code on the server side
Code:
#!/bin/perl -w
use strict;
use IO::Socket;
print "Hello welcome to the Fs server\n";
my $sock = new IO::Socket::INET (
LocalHost => 'charlie',
LocalPort => '7073',
Proto => 'tcp',
Listen => 1,
Reuse => 1,
);
die "Could not create socket: $!\n" unless $sock;
print " Great just created a socket\n";
my $new_sock = $sock->accept();
while(defined(<$new_sock>)) {
print $_;
}
close($sock);
and this code on the client side
Code:
#!/bin/perl -w
use strict;
use IO::Socket;
print " Hello welcome to the fsclient\n";
my $sock = new IO::Socket::INET(
PeerAddr => 'charlie',
PeerPort => '7073',
Proto => 'tcp',
);
die "Could not create socket: $!\n" unless $sock;
print $sock "Hello there!\n";
close($sock);
when i run this server followed by the client this is the error i get
[jnsahibz@charlie assignment2]$ fsserver.pl
Hello welcome to the Fs server
Great just created a socket
Use of uninitialized value at ./fsserver.pl line 19, <GEN1> chunk 1.