Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help on my code .....

Status
Not open for further replies.

enterdavertex

Programmer
Apr 15, 2010
1
CA
Server
Code:
#! /usr/bin/perl -w
use FileHandle;
use Socket;
$filename = "/tmp/temporarily";
socket(SERVER,PF_UNIX, SOCK_STREAM, 0) or die"Can't create socket SERVER\n";
autoflush SERVER 1;
bind(SERVER,sockaddr_un("/tmp/0805638") or die"Can't bind server\n";
listen(SERVER,0) or die"Can't listen";
for(;;){
accept(DATA,SERVER);
print <DATA>;
close DATA;
}
error Wrote:
Useless use of a constant in void context at Server.pl line 7.
syntax error at Server.pl line 7, near ""Can't bind server\n";"
Execution of Server.pl aborted due to compilation errors.
Client
Code:
#! /usr/bin/perl -w
use FileHandle;
use Socket;
socket (CLIENT, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
autoflush CLIENT 1;
connect(CLIENT, sockaddr_un($filename)) or die "connect: $!";
accept(DATA,CLIENT);
print CLIENT "I have now sent you some very important information";
error said:
#! /usr/bin/perl -w
use FileHandle;
use Socket;
socket (CLIENT, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
autoflush CLIENT 1;
connect(CLIENT, sockaddr_un($filename)) or die "connect: $!";
accept(DATA,CLIENT);
print CLIENT "I have now sent you some very important information";
 
You are also missing some fundamental posting etiquette, although if nothing else it is at least succint...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top