Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Currently in Perl 5.10.1
I succeeded in denting the wall with my head trying to perform a rather simple task. Starting with a simple ASCII string I need to
any help will be greatly appreciated.
- find its length
- convert the length into 2 hex bytes.
I need to convert the length (12) to the string "\x00\x0c"my $string = "39860000NO00"; my $length = length($string);
any help will be greatly appreciated.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Convert to Hexadecimal
by davido (Cardinal) on May 17, 2012 at 18:03 UTC | |
by sauoq (Abbot) on May 17, 2012 at 19:07 UTC | |
by martydavis (Initiate) on May 17, 2012 at 18:53 UTC | |
Re: Convert to Hexadecimal
by sauoq (Abbot) on May 17, 2012 at 19:00 UTC | |
Re: Convert to Hexadecimal
by afoken (Chancellor) on May 17, 2012 at 17:11 UTC | |
Re: Convert to Hexadecimal
by ikegami (Patriarch) on May 17, 2012 at 19:12 UTC |
Back to
Seekers of Perl Wisdom