On Fri, 2009-11-06 at 17:21 -0500, Nathan Gibbs wrote:
> How would I get the length of a string as returned by length () into
> 
> a 4 byte unsigned integer in  network byte order
> 
> Thanks
> 
> -- 
> But there's no sense crying over every mistake.
> You just keep on trying till you run out of cake.
> And the Science gets done.
> And you make an income.
> For the people who are still alive.
> 

It's simple.

$unsigned_4byte_int = pack 'N', length($your_string);

-- 
Krasnorutsky Alexander.


-- 
To unsubscribe, e-mail: beginners-cgi-unsubscr...@perl.org
For additional commands, e-mail: beginners-cgi-h...@perl.org
http://learn.perl.org/


Reply via email to