Re: Data Conversion ?
[email protected] (Alexander Krasnorutsky) Sat, 07 Nov 2009 13:43:48 +0500
| Newsgroups | perl.beginners.cgi |
|---|---|
| Message-ID | <[email protected]> |
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.