in reply to How to Open Files from Subdirectory

I fail to open these two files with this snippet.
# mycode.pl my $file = "/files/data.pri"; my $name = (split(/[\/\.]/,$file))[2]; my $file_sec = "/files/$name.sec"; my $result = some_function($file,$file_sec);
I beg your pardon, since I know that my reply doesn't add anything to the good advices you already got, but it seems to me that "this snippet" does nothing to open any file except possibly in some_function, in which case it could be worth to show the code for it too. Or else the problem may not be an actual open, in which case your title may end up being confusing.