in reply to Re: Reading binary files - program structure
in thread Reading binary files - program structure
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Reading binary files - program structure
by Anonymous Monk on May 25, 2010 at 16:47 UTC | |
by BrowserUk (Patriarch) on May 25, 2010 at 20:50 UTC |