in reply to Multiple files opened

INP would have to be closed for the other file to be read in the subroutine

Why? The subroutine does not need to use the same file handle name INP, and you can certainly have two files open at the same time. There are limits, but 2 is reasonable. Just make sure you close the file handles - lexical handles will help with that, as it will with file handle name collisions:
open(my $inp, '<', $file_list) or die("Error reading $file_list: $!"); while (<$inp>) { ... } close $inp;
I also don't get why you are using an RE rather than chomp. Anyway, your assignment to $data_file probably does not do what you think it does - did you trty printing it out?

Replies are listed 'Best First'.
Re^2: Multiple files opened
by k_manimuthu (Monk) on Sep 24, 2010 at 07:47 UTC

    kokakola613

    If you provide the "$file_list" few contents and show your subroutine piece of code, then Monks would be able to give their suggestions efficiently.

    Please show that.