Substitute first occurrence of "blue" with "red"
$str = "gree, red, blue, blue, blue..."; $str =~ s/blue/red/; print $str;