Code Comments
Programming Forum and web based access to our favorite programming groups.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. **************************************** ************************************ **
Post Follow-up to this messageGayatri 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
Post Follow-up to this messageOn 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
Post Follow-up to this messageHello 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. **************************************** ************************************ **
Post Follow-up to this messageGayatri 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
Post Follow-up to this messageGayatri 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
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.