No such thing as a small change | |
PerlMonks |
Re: Unpacking variable length bit fieldsby Limbic~Region (Chancellor) |
on Jun 18, 2012 at 20:36 UTC ( [id://976892]=note: print w/replies, xml ) | Need Help?? |
puterboy,
Assuming this data is in a string, I would do something like:
This is like using seek which is exactly what you were trying to avoid (iteratively calling pack) but if wrapped in the proper abstraction can be very clean. Update: After reading BrowserUk's response and re-reading your post, I realize I incorrectly assumed you had multiple records in the string - each one with variable length fields. Please ignore me. Cheers - L~R
In Section
Seekers of Perl Wisdom
|
|