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