use Tie::File; tie my @file, 'Tie::File', $position_output_path; @file = @rows; untie @file;