in reply to Re: updating file
in thread updating file

A nit...these scripts won't update the file if $newcolor is a substring of a color already in the file. For example if the file has:
red-orange bluegreen
and you try to add one of the colors red, blue, or green, your script won't add it.

The regexp should probably be anchored and chomp used:

chomp($color); $seen++ if $color =~ /^$newcolor$/;
or eq could be used instead:
chomp($color); $seen++ if $color eq $newcolor;