in reply to If statement not working
Wouldn't that reduce your if-else series to this:%mapping=( 'baby blue'=>'BB', 'baby pink'=>'BP', 'dark blue'=>'DB', #and so on... );
Also, if new colors are added, you'd only need to add an entry in the hash.$trimmedcolr=$mapping{$colr};
|
|---|