in reply to Re: Last day of the month. Any shorter
in thread Last day of the month. Any shorter

I'd like to if I understood what is happening here.
  • Comment on Re: Re: Last day of the month. Any shorter

Replies are listed 'Best First'.
Re: Re: Re: Last day of the month. Any shorter
by Ven'Tatsu (Deacon) on May 19, 2004 at 14:44 UTC
    unpack extracts values of various types from a string based on a format, in this case A4A2A2, and returns them as a list.
    A is a space padded sting of bytes, the number after it is the number of bytes in each value.
    So this format will return a string of the first 4 bytes (stripping away any trailing spaces if there were any) then the next 2 bytes and then the next 2 bytes.
    The end result is identical to the 3 calls to substr, but a bit more concise.