IO::Socket - i can't get it to read the data
greetings, This program listens on a port for an incoming connection. Once someone connected it asks for a name and a password. but for some reason I can't get it to read the name/password entered. what am i missing please... while (($client,$client_address) = $server-accept()) { # Get the client ip ($client_port, $c_ip) = sockaddr_in($client_address); $clientip = inet_ntoa($c_ip); print $client \nname\n; chomp ($cl_name = $client); print $client pass\n; chomp ($cl_pass = $client); print $client \n$cl_name $cl_pass $clientip\n; } e. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: IO::Socket - i can't get it to read the data
ok it seems like the chomp it stuffin it up ? if i removed it i get the correct data but with a \n On Friday 15 October 2004 11:56, Etienne Ledoux wrote: greetings, This program listens on a port for an incoming connection. Once someone connected it asks for a name and a password. but for some reason I can't get it to read the name/password entered. what am i missing please... while (($client,$client_address) = $server-accept()) { # Get the client ip ($client_port, $c_ip) = sockaddr_in($client_address); $clientip = inet_ntoa($c_ip); print $client \nname\n; chomp ($cl_name = $client); print $client pass\n; chomp ($cl_pass = $client); print $client \n$cl_name $cl_pass $clientip\n; } e. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: IO::Socket - i can't get it to read the data
Would anybody have any idea why chomp is deleting the value ? No matter how I try and do it. I even tried s/\n//,$value . afterwards I have a empty value. I don't understand what I'm doing wrong here and everywhere i check this it seems to be the right way to do it. ?!?! e. On Friday 15 October 2004 12:16, Etienne Ledoux wrote: ok it seems like the chomp it stuffin it up ? if i removed it i get the correct data but with a \n On Friday 15 October 2004 11:56, Etienne Ledoux wrote: greetings, This program listens on a port for an incoming connection. Once someone connected it asks for a name and a password. but for some reason I can't get it to read the name/password entered. what am i missing please... while (($client,$client_address) = $server-accept()) { # Get the client ip ($client_port, $c_ip) = sockaddr_in($client_address); $clientip = inet_ntoa($c_ip); print $client \nname\n; chomp ($cl_name = $client); print $client pass\n; chomp ($cl_pass = $client); print $client \n$cl_name $cl_pass $clientip\n; } e. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
network sockets.
greetings, I'm attempting a perl program that will listen on a port for a connection. when a connection is made some info will be transfered and the client will disconnect. I've never done this before but seem to be making some progress with all the resources available on the net. I was just wondering. You can use 'Socket' or 'IO::Socket' to do almost the same thing, it seems. Which is the best or most preferred method to use ? I used 'Socket' and so far so good. But I was just wondering what is the difference and preferred way ? tx e. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
how can I |more output.
Greetings, I have a program that does a search on a db and prints the output to the screen. If there is a lot of output how can I a stop/continue displaying it. like 'ls -l |more' would do. or anything |more for that matter. tx e. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: how can I |more output.
On Thursday 26 August 2004 09:20, Ramprasad A Padmanabhan wrote: On Thu, 2004-08-26 at 12:28, Etienne Ledoux wrote: Greetings, I have a program that does a search on a db and prints the output to the screen. If there is a lot of output how can I a stop/continue displaying it. like 'ls -l |more' would do. or anything |more for that matter. tx e. why not |more Ram *bang-head-on-desk* after I sent the mail. I thought it would be funny if the answer actually was |more. I'll try it. tx! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response
Re: how can I |more output.
ok. Here is the output I'm trying to '|more' while (@ref = $sth-fetchrow_array()) { print Username: $ref[0], Password: $ref[1]\n; } I tried putting |more at various positions where I thought it might work. But it doesn't work as expected. On Thursday 26 August 2004 09:31, Etienne Ledoux wrote: On Thursday 26 August 2004 09:20, Ramprasad A Padmanabhan wrote: On Thu, 2004-08-26 at 12:28, Etienne Ledoux wrote: Greetings, I have a program that does a search on a db and prints the output to the screen. If there is a lot of output how can I a stop/continue displaying it. like 'ls -l |more' would do. or anything |more for that matter. tx e. why not |more Ram *bang-head-on-desk* after I sent the mail. I thought it would be funny if the answer actually was |more. I'll try it. tx! -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response