in reply to Re: Unpack/format
in thread Unpack/format

If your format string doesn't have terribly fancy template characters (i.e. doesn't have things like "w"), and yours which are all "a" and "x" fit the bill, you can do
$expected_length = length(pack($fmt))
This returns 14 for the format string of "a4 x1 a4 x1 a4".
Hope this helps...

-JAS

Replies are listed 'Best First'.
Re: Unpack/format
by Reverend Phil (Pilgrim) on Feb 13, 2002 at 23:13 UTC
    HA!
    Can't see the trees for the forest! While TIMTOWTDI, this is the one I'm looking for. I should kick myself for not seeing that! In fact.. hang on a moment..



    OW!


    Thanks a ton =)
    -=rev=-