Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: (Zigster) Newline Character and Socket Comms

by zigster (Hermit)
on May 04, 2001 at 19:13 UTC ( #77977=note: print w/replies, xml ) Need Help??


in reply to Newline Character and Socket Comms

I presume you mean you changed the server code to include:
for(my $i=0; $i <= 10; $i++) { print $new_sock "$i\n"; }
Within the while loop instead of the
my $msg = <$new_sock>; print "client said '$msg'\n";
I have tried this and all seems to work fine. Can you confirm a few more details regarding what you are doing and on what platform.
Taa Update As tilly pointed out, in CB, it is a good idea to get out of the habit of using C style for loops use for my (1..10) {stuff}. Tiss neater and nice and clear. Not directly relevent but very good advice all the same. Cheers Tilly
--

Zigster

Replies are listed 'Best First'.
Re: Re: (Zigster) Newline Character and Socket Comms
by Ducati (Beadle) on May 04, 2001 at 21:49 UTC

    I put the for loop in on the client side ... the loop sends the data to the server ... the while loop is on the server side and it loops waiting for more data.

    I was expecting:

    0 1 2 ...

    But I get:

    '0 '

    ============================================

    "We rock the body to rock the party ... until the party rocks the body"

    De La Soul

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://77977]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2022-01-18 05:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (52 votes). Check out past polls.

    Notices?