$line =~ s/\$red(\d)/$red[$1]/g; [download]
In reply to Re: How would I replace the string 'Red1' with $Red1? by chipmunk in thread How would I replace the string 'Red1' with $Red[1]? by draco_iii