shadox has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone, i am almost ready with the MSN perl module that i was talking here
a few days ago, but since it is my first program with sockets, i have a little
problem, this subroutine gets the server answers of my request, usually the server
answer with just one line, and this sub works just fine, but if i modify it to get
more than one lines it don't do anything :(
The modifications that i've tried are:
change
my @lines = <$sock>;
And it didn't work , and the other was
With any of the 2 changes it doesn't work
Any help.
Thanx all
Dreams they just disapear into the shadows,
then they become true....
change
tomy $line = <$sock>;
my @lines = <$sock>;
And it didn't work , and the other was
while ( my $line = <$sock> ) { #more stuff }
With any of the 2 changes it doesn't work
Any help.
Thanx all
sub sendCommands{ if (@_) { print $sock "$_[0]\r\n"; #$sock is a socket to the server my $line = <$sock>; print "Client: $_[0]\r\nServer: $line" if $DEBUG; my @values = split(/ /,$line); return @values if ( $line ) } }
Dreams they just disapear into the shadows,
then they become true....
Back to
Seekers of Perl Wisdom