Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

require "sys/socket.ph";
Dear All,

I am facing one problem if any body knows the solution please let me know.



file name : ch.pl..

use Socket;

require "sys/socket.ph";    # for &TCP_NODELAY

socket (SERVER,  AF_INET, SOCK_STREAM,0); setsockopt(SERVER, SOL_SOCKET,
&TCP_NODELAY, 1)

or die "Couldn't disable Nagle's algorithm: $!\n";





when the file is compiled, it's throwing error like this..

Scalar found where operator expected at (eval 148) line 1, near "'int'

$__val"

(Missing operator before   $__val?)

Undefined subroutine &main::__LONG_MAX__ called at (eval 316) line 1.

Compilation failed in require at

/usr/lib/perl5/5.8.1/i386-linux-thread-multi/sys/socket.ph line 11.

Compilation failed in require at ch.pl line 2.



Thanks in Advance



Thanks & Regards

-Gayatri


 ***************************NOTE*********
************************************
**
Deccanet Designs Ltd is now Flextronics Design Ltd, India
 ****************************************
************************************
**



 *************************DISCLAIMER*****
************************************
**
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege of Flextronics Design Ltd.
If you have received this message in error, please notify the originator
immediately. If you are not the intended recipient, you are notified that
you are strictly prohibited from retaining, using, copying, altering or
disclosing the contents of this message.
 ****************************************
************************************
**


Report this thread to moderator Post Follow-up to this message
Old Post
Gayatri
05-30-05 01:56 PM


Re: require "sys/socket.ph";
Gayatri wrote:
> Dear All,

Hello,

>  I am facing one problem if any body knows the solution please let me know
.
>
>
>
> file name : ch.pl..
>
> use Socket;
>
> require "sys/socket.ph";    # for &TCP_NODELAY
^^^^^^^^^^^^^^^^^^^^^^^^^^

Remove that line and it should work (TCP_NODELAY is included in the Socket
module.)

> socket (SERVER,  AF_INET, SOCK_STREAM,0); setsockopt(SERVER, SOL_SOCKET,
> &TCP_NODELAY, 1)
>
>     or die "Couldn't disable Nagle's algorithm: $!\n";


John
--
use Perl;
program
fulfillment

Report this thread to moderator Post Follow-up to this message
Old Post
John W. Krahn
05-30-05 08:55 PM


Re: require "sys/socket.ph";
On Mon, 30 May 2005 16:20:16 +0530, gayatri@deccanetworld.com (Gayatri)
wrote:

>Dear All,
>
> I am facing one problem if any body knows the solution please let me know.

>use Socket;
>
>require "sys/socket.ph";    # for &TCP_NODELAY

Well John Krahn probably gave you the answer, but just in case,
read "man h2ph" and/or "perldoc h2ph".

It explains how you can run the h2ph command to convert
your systems .h files to perls .ph files.



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html

Report this thread to moderator Post Follow-up to this message
Old Post
Zentara
05-31-05 08:57 PM


RE: require "sys/socket.ph";
Hello John,
Thanks for ur Reply.
But Now I am getting the following error please help if u can.
Thanks in advance


---if i remove  require "sys/socket.ph";  line it gives error as

----Undefined subroutine &main::TCP_NODELAY called at
/home/laxmig/Projects/NMD/Testing/SouceCode/modules/frag.pm line 380

----can you please tell me exactly what library path to include for
this error?..

-Gayatri
-----Original Message-----
From: John W. Krahn [mailto:krahnj@telus.net]
Sent: Monday, May 30, 2005 8:06 PM
To: Perl Beginners
Subject: Re: require "sys/socket.ph";

Gayatri wrote:
> Dear All,

Hello,

>  I am facing one problem if any body knows the solution please let me
know.
>
>
>
> file name : ch.pl..
>
> use Socket;
>
> require "sys/socket.ph";    # for &TCP_NODELAY
^^^^^^^^^^^^^^^^^^^^^^^^^^

Remove that line and it should work (TCP_NODELAY is included in the Socket
module.)

> socket (SERVER,  AF_INET, SOCK_STREAM,0); setsockopt(SERVER, SOL_SOCKET,
> &TCP_NODELAY, 1)
>
>     or die "Couldn't disable Nagle's algorithm: $!\n";


John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




 ***************************NOTE*********
************************************
**
Deccanet Designs Ltd is now Flextronics Design Ltd, India
 ****************************************
************************************
**



 *************************DISCLAIMER*****
************************************
**
This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege of Flextronics Design Ltd.
If you have received this message in error, please notify the originator
immediately. If you are not the intended recipient, you are notified that
you are strictly prohibited from retaining, using, copying, altering or
disclosing the contents of this message.
 ****************************************
************************************
**

Report this thread to moderator Post Follow-up to this message
Old Post
Gayatri
06-02-05 01:58 PM


Re: require "sys/socket.ph";
Gayatri wrote:
> Hello John,

Hello,

> Thanks for ur Reply.
> But Now I am getting the following error please help if u can.
> Thanks in advance
>
>
> 	---if i remove  require "sys/socket.ph";  line it gives error as
>
> 	----Undefined subroutine &main::TCP_NODELAY called at
> /home/laxmig/Projects/NMD/Testing/SouceCode/modules/frag.pm line 380
>
> 	----can you please tell me exactly what library path to include for
> this error?..

Put this line near the top of your file:

use Socket ':all';



John
--
use Perl;
program
fulfillment

Report this thread to moderator Post Follow-up to this message
Old Post
John W. Krahn
06-02-05 01:58 PM


Re: require "sys/socket.ph";
Gayatri wrote:
> Sorry to trouble you again but John when I run like that it is giving erro
r
> as follows
>
> "Couldn't disable Nagle's algorithm: Permission denied"
>
> The code is as follows.....
> use Socket ':all';
>
> socket($sock, AF_INET, SOCK_STREAM,$proto)||die "Socket call
>             failed";
> setsockopt($sock, SOL_SOCKET, &TCP_NODELAY, 1)
>                   or die "Couldn't disable Nagle's algorithm: $!\n";
>
> Couldn't disable Nagle's algorithm: Permission denied
>
> does it need to be run under super user privilege??, because when i checke
d
> with super user it works fine without giving error.
>
> Is it a solution???
>
> Or anyother alternate is there??

This thread on Perl Monks should be helpful:

http://www.perlmonks.com/index.pl?node_id=418728



John
--
use Perl;
program
fulfillment

Report this thread to moderator Post Follow-up to this message
Old Post
John W. Krahn
06-03-05 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:39 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.