in reply to Doing multiple search and replace operations on a string
my %exponent = ( T => 12, G => 9 , M => 6 , k => 3 , p => -12, n => -9, u => -6, m => -3, ); s/\d(\w)\s/exists $exponent{$1} ? 'e' . $exponent{$1} : '' /ge;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Doing multiple search and replace operations on a string
by johngg (Canon) on Feb 20, 2014 at 23:06 UTC | |
by letssee (Initiate) on Feb 21, 2014 at 04:21 UTC |