Find a word which is after a pattern and before another pattern using perl

I want to find a word in a file which is after a particular pattern and before a particular pattern.
Here is the content from the file:

print("Hi", "My name is", "Tej");

So, I want to get the word

Tej

alone and store it into an array. Similarly, I have many such files with similar pattern as above but with different names, so I want to push all those names into an array. i.e. I want the words from the from the files which are after the pattern

print("Hi", "My name is", "

and before the pattern

");

.

I wrote the script for opening files and passing the file handle to a function to search for the word which is after and before the pattern. The code for the function is as follows: