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) }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: If statement not working
by toolic (Bishop) on Aug 24, 2012 at 13:53 UTC | |
Re: If statement not working
by cheekuperl (Monk) on Aug 24, 2012 at 13:59 UTC | |
Re: If statement not working
by Marshall (Canon) on Aug 24, 2012 at 13:58 UTC | |
by andye (Curate) on Aug 24, 2012 at 15:09 UTC | |
by Marshall (Canon) on Aug 26, 2012 at 01:17 UTC | |
Re: If statement not working
by andye (Curate) on Aug 24, 2012 at 14:54 UTC | |
Re: If statement not working
by GrandFather (Saint) on Aug 25, 2012 at 01:05 UTC | |
Re: If statement not working
by NetWallah (Canon) on Aug 24, 2012 at 15:14 UTC |
Back to
Seekers of Perl Wisdom