Apterigo has asked for the wisdom of the Perl Monks concerning the following question:
and on and on. The 0x00 is there to mean that each "string" is seperated by hex 00. What I am trying to do is read all the data from each "string" into one variable and stop reading when 0x00 is reached. Now, for some reason, I am having a heck of a time getting it to work. Here is my code (please note that this is only a portion, obviously):14|XXX\XXX|1.2541|1.2546|0|2001-07-17 10:25:22.17 0x00 16|XXX\XXX|1.2 +547|1.2552|0|2001-07-17 10:26:23.23 0x00
do { $socket->recv($response, 1); $data = $data . $response; } until ($response == hex(0x00)); print "$data\n"; close($socket) || die "Error terminating socket connection...\n";
Edit ar0n 2001-07-18
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parsing data from a data feed
by bikeNomad (Priest) on Jul 19, 2001 at 00:09 UTC | |
|
Re: Parsing data from a data feed
by Apterigo (Scribe) on Jul 19, 2001 at 00:33 UTC | |
by bikeNomad (Priest) on Jul 19, 2001 at 01:18 UTC |