>     $client->recv($recv, 128);
>     chomp($recv);
> 
>     if (exists($commands{$recv})) {
>         $client->send("Works! Received: $recv");
>     } else {
>         $client->send("Doesn't work! We received this: $recv");
>     }
> }
> 
> The code above doesn't print out anything for $recv, however if I remove 
the
> chomp($recv) it works fine. Anyone got any idea's why running a chomp on
> this variable causes it to not be displayed at all? The variable does
> contain a newline so I do need to have it removed.
> 
Hi Shane,
Can you be a little more specific?
When you chomp, do you get the "Doesn't work" return with nothing from 
$recv variable?
When you don't chomp, do you also get "Doesn't work" returning the string 
from $recv variable?

What I'm asking, is does the hash list also contain a new line, so when 
you chomp, it no longer matches?

Regards,

Scott
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to