Firstly, I must 'fess up. I don't know Perl. I'm needing to move a large Perl application to a small embedded system and it needs to go on a serious diet.
The application has many 10's of MB of computer generated data files that contain text like this:
%my_flds =
(
"DIS" => [ 0, 33, 1, 0x0000000200000000, 0x00, 1, 0x0000000000000
+000, "" ],
"L2" => [ 1, 24, 8, 0x00000000FF000000, 0x00, 1, 0x0000000000000
+000, "" ],
"L1" => [ 2, 16, 8, 0x0000000000FF0000, 0x00, 1, 0x0000000000000
+000, "" ],
"L0" => [ 3, 15, 1, 0x0000000000008000, 0x00, 0, 0x0000000000000
+000, "" ],
"LDIS" => [ 4, 14, 1, 0x0000000000004000, 0x00, 1, 0x0000000000000
+000, "" ],
"LCNT" => [ 5, 13, 1, 0x0000000000002000, 0x00, 1, 0x0000000000000
+000, "" ],
);
%my_def =
( NAME => "CONFIG",
ADDRESS => 0x400000,
LENGTH => 64,
FLAGS => 0x001,
NOTE => "",
RESET => 0x0000000000000000,
FIELDS => \%my_flds
);
Can this be packed down into a simple binary file? If so, how would I modify the app to read this binary file?
Are there any other strategies you would recommend for reducing the footprint of an application?
Thanks,
Matt.