in reply to Re: Speeding up perl script
in thread Speeding up perl script
foreach $filename (@input_names) #Go through input files { ($names_ref,$data_ref) = &read_file($filename); @tmp_names = @$names_ref; @tmp_data = @$data_ref; foreach $name (@tmp_names) #Go through lines of current input +file { $index = &find_element($name, @names); #Check if variable +is already present in name array (time consuming!) if ($index==-1) #Name not present, put both name and data +in array { push(@names,$name); push(@data,$tmp_data[$tmp_index]); } else #Name present, only replace data for the name { $data[$index] = $tmp_data[$tmp_index]; } $tmp_index++; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Speeding up perl script
by Corion (Patriarch) on Jan 28, 2009 at 09:13 UTC | |
|
Re^3: Speeding up perl script
by jettero (Monsignor) on Jan 28, 2009 at 10:10 UTC |