In that case, the path is not the cause on why my socket program wont work. I've change the first line (the path) to the perl interpreter but it still wont work. Below is the snippet of the code, in case I am missing anything.
--code-- #!/usr/contrib/bin/perl -w require 5.002; use strict; use Socket; my ($remote, $port, $iaddr, $paddr, $proto, $line); $remote = shift || '10.18.4.11'; $port = shift ||1997; if ($port =~ /\D/) { $port = getservbyname($port, 'tcp') } die "No port" unless $port; $iaddr = inet_aton($remote) or die "no host: $remote"; $paddr = sockaddr_in($port, $iaddr); $proto = getprotobyname('tcp'); socket(SOCK, PF_INET, SOCK_STREAM, $proto) or die "socket: $!"; if (!connect(SOCK,$paddr)) { my $try = "/test/broadcast.sh"; die "Connection refused. Please check the internal line."; } else{ my $oldfd = select (SOCK); $| = 1; select ($oldfd); #listing of po files in the directory. my $ls_dir = "/bin/ls /export/home/anil/test/po "; print ($ls_dir); open (fFD, "$ls_dir |") || die "Sorry can't process ls"; my $count = 0; #array for storing the filenames my @filename; my $myFile; #initialize the $status as 0 my $status = 0; while(<fFD>) { if (($_ =~ /\.po/)) { #read the file $myFile = $_ || die ("something wrong?"); #updates the status as 1 $status = 1; } }#end while reading listing #if file is found, send the first file if ($status == 1) { @filename = split("\n",$myFile); print "fetch file"; print ($filename[0],"\n"); unless(open(FILE, $filename[0])){ if (!(-s $filename[0])){ die ("non-empty"); } elsif (!(-r $filename[0])){ die ("not allowed to read"); } elsif (!(-e $filename[0])){ die("file does not exist");} elsif (!(-d $filename[0])){ die ("directory"); } else{ die ("cannot open the file");} } # print SOCK ($myFile); while(<FILE>) { print SOCK or die "cannot print to socket\n"; } close(fFD); my $theFile = $myFile; chop ($theFile); } #end if file exist close (SOCK) or die "close: $!"; } exit; -code- "R. Joseph Newton" wrote: > anil adenan wrote: > > > I dont understand. Where or how do we create this link ( ln -s > > /opt/perl/bin/perl /usr/bin/perl)? > > No. Read again: > > > .... The perl installation will create this link for you, BTW. > > > > > > Joseph > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]