good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
RE: RE: pack / unpack woesby davorg (Chancellor) |
on Aug 24, 2000 at 17:54 UTC ( [id://29417]=note: print w/replies, xml ) | Need Help?? |
I think you might be misundertanding what agoth is doing with the unpack lc($FMT}, pack $FMT, @data construction. Effectively the code is equivalent to this (simplifying the templates):
Using 'A' in the pack template will pad each field with spaces to the width of the field as given in the template and using 'a' in the unpack template will leave those spaces untouched when the string is split again (using 'A' would strip the spaces) It might be easier to do something using sprintf and split. --<http://www.dave.org.uk> European Perl Conference - Sept 22/24 2000, ICA, London <http://www.yapc.org/Europe/>
In Section
Seekers of Perl Wisdom
|
|