in reply to Avoid run-time checking
Are the files ever mixed endianness? Where does $endian come from , how is endianness determined?
So far, the only idea I have came up - create 2 tables of unpack template, one for big and one for little and select once after determining endianness.
That can make sense, you've identified a repetitive copy/paste pattern and you're refactoring/abstracting away the repetitiveness, so next step is to actually make two modules with same API, so you can use MyRecs -bigendian; and you get in your program a record_xxx() which is an alias for MyRecs::BigEndian::record_xxx()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Avoid run-time checking
by bagyi (Acolyte) on Sep 12, 2015 at 07:34 UTC | |
by Anonymous Monk on Sep 12, 2015 at 09:01 UTC |