perlnoobster has asked for the wisdom of the Perl Monks concerning the following question:
hi guys,
I was wondering if someone could help me, I've got a list of strings that need to be scrubbed, my method below isn't the most efficient but i am unsure of other methods that can help me:
whilst the code is run it only replaced the strings that contain light pink excluding everything else? please can someone help me fix this? Thank you :)if ($colr =~'baby blue') { $trimmedcolr = 'BB'; } if ($colr =~'baby pink') { $trimmedcolr = 'BP'; } if ($colr =~'dark blue') { $trimmedcolr = 'DB'; } if ($colr =~'dark purple') { $trimmedcolr = 'DP'; } if ($colr =~'hot pink') { $trimmedcolr = 'HP'; } if ($colr =~'light purple') { $trimmedcolr = 'LP'; } else { ($trimmedcolr = $colr) }
Back to
Seekers of Perl Wisdom