in reply to Problem changing only first occurence of pattern in file
perl -pe "/yes$/../no$/ and s/no$/yes/" [download]