almut has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone,
while composing a reply to To 'pack' or 'unpack' that is the question, I once again stumbled
across the following (perceived?) oddity in Perl-5.10's pack docs:
(...)
One or more of the modifiers below may optionally follow some letters in the TEMPLATE (the second column lists the letters for which the modifier is valid):! sSlLiI Forces native (short, long, int) sizes instead of fixed (16-/32-bit) sizes. xX Make x and X act as alignment commands. nNvV Treat integers as signed instead of unsigned. @. Specify position as byte offset in the internal representation of the packed string. Efficient but dangerous. > sSiIlLqQ Force big-endian byte-order on the type. jJfFdDpP (The "big end" touches the construct.) < sSiIlLqQ Force little-endian byte-order on the type. jJfFdDpP (The "little end" touches the construct.)
In particular, I'd be interested in "Treat integers as signed instead of unsigned".
Is it only my slowly deteriorating sight, or is there really some character missing in front of the "nNvV"? In case of the latter, does anyone know what that modifier should be?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl 5.10 pack() template modifier "treat signed"
by gwadej (Chaplain) on Nov 11, 2008 at 18:30 UTC | |
by almut (Canon) on Nov 11, 2008 at 18:40 UTC | |
|
Re: Perl 5.10 pack() template modifier "treat signed"
by ikegami (Patriarch) on Nov 11, 2008 at 20:36 UTC | |
|
Re: Perl 5.10 pack() template modifier "treat signed"
by gone2015 (Deacon) on Nov 11, 2008 at 17:51 UTC | |
by almut (Canon) on Nov 11, 2008 at 18:04 UTC | |
by gone2015 (Deacon) on Nov 11, 2008 at 19:18 UTC | |
by almut (Canon) on Nov 11, 2008 at 19:39 UTC |