I confused with pack and unpack while writing a Perl script. What is the difference between between pack and unpack in Perl (explain with a simple example)?
Do you understand the difference between split and join? unpack is a bit like split (it takes a string and produces a list of values) and pack is a bit like join (it takes a list of values and produces a string.
packtakes a list of values and converts it into a string using the rules given by the template.unpacktakes a string and expands it out to a list of values using the rules given by the template.