in reply to Calling a Variable from another file

I've never actually done what I'm about to propose, so there may be pitfalls I haven't thought of, but assuming that the assignment to my $res is the last executable statement in mydata.pl, I would try something like

my $whatever = do 'mydata.pl';
That should be equivalent to assigning to $whatever the value returned by eval'ing the contents of mydata.pl.

I question the whole approach on design grounds, however. See this thread for some possible alternatives.

the lowliest monk