in reply to Assigning value to the array elements

Several people have offered alternatives to what you're trying to do, and that's good. But nobody has told you why you shouldn't be doing it, and that's explained by MJD.

Because I am a bad person, I'll tell you that you can do what you want by a) saying ${$vars[$i]}=$_, b) removing the "my" from $first='' and so on, and c) removing the dollar signs from @vars. But don't do that.