Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: Parsing data from a data feedby bikeNomad (Priest) |
on Jul 19, 2001 at 00:09 UTC ( [id://97871]=note: print w/replies, xml ) | Need Help?? |
You don't want to compare the characters with hex(0x00), because this is just a 0. Comparing arbitrary strings with 0 won't work, since non-numeric ones will evaluate to 0. You want to say something like $response == "\x00" Beyond that little problem, you're not checking the status in the recv call. You might try instead letting the getline call work and get your data a record at a time, by setting the input record separator $/ to NUL:
update: you may have been thinking about chr(0) which returns "\x00".
In Section
Seekers of Perl Wisdom
|
|