in reply to variables in substition/eval
$ln is an alias to the items of the list, so the first time thru the loop it modifies @lines, so it no longer says "scrooge" and the regex doesn't match anymore. Try dumping @lines to see and assign $ln to a new var and modify that.