in reply to Use of SWITCH vs IF ELSE in speed and readability
If you're really comparing based on small integers, and really modifying the value of variables in a similar way, I would consider using an array of scalar references .... or re-writing to use an array or hash to replace the scalars:
my @table = ( \$abc, \$def, \$wyz ); $table[$x] = 1; # or my @categories; $categories[$x]++; # or my %categories; $categories{$x} = code2value( $x );
Not a religious thing, but it does have the advantage of automatically handling new categories, if you can arrange for the returned values to remain small integers.
--
TTTATCGGTCGTTATATAGATGTTTGCA
|
|---|