sub readVECFile($) { my ($filename, @fileData, $line, $vectorRef, $time, $data); local *VECTOR; # Get the filename. $filename = shift(@_); # Create a new hash. $vectorRef = { 'time' => \(), 'data' => \() }; # Open the vector file. open(VECTOR, $filename) or die("Unable to open '$filename' for reading!\n"); # Read in the raw file data. @fileData = ; chomp @fileData; # Parse the time and data values out of each line, creating two arrays. foreach $line (@fileData) { my ($t, $d); ($t, $d) = split(/\t/, $line); push(@{$vectorRef->{time}}, $t); push(@{$vectorRef->{data}}, $d); } # Close the file. close(VECTOR); return $vectorRef; }