in reply to Why does the array not reset each time I call the function?

I do not understand why the variable @data_file keeps the data from the previous call.
The array is not keeping the data, your data file is keeping it. I believe that you are reading the the data from your file into @data_file here:
open(DATA, $dac03_location."/".$file) or die "Cannot open the file +!"; #Store the text in an array, easier to work with while(<DATA>){ chomp; push(@data_file,$_); } close(DATA);

Replies are listed 'Best First'.
Re^2: Why does the array not reset each time I call the function?
by tuxy94 (Initiate) on Apr 02, 2008 at 10:23 UTC
    Thanks, yes I am reading the data from my file to place it in @data_file. But by doing close(DATA); am I not clearing all what could have been saved in DATA?