I think would prefer to use subs rather than string eval here. Eg.
my %varlengths = ( 'that' => sub(){ 2 }, 'theother' = sub{ $v{this}*2 }, } ... $readlength = $varlengths{$var}->(); # compute it
Slightly more work, but worth it I think.
In reply to Re^2: Reading binary files - program structure
by BrowserUk
in thread Reading binary files - program structure
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |