use strict; use warnings; #good! use Win32::OLE; use Date::Calc; use diagnostics; my %header_data; my $f_mfg_desk = '//163.10.50.33/planning/logistics/programs/chicago_wip_query2.txt'; my $f_mfg_desk2 = '//163.10.50.33/planning/logistics/programs/chicago_wip_query3.txt'; my ($sec, $min, $hour, $dayofmonth, $month, $year, $weekday, $day) = localtime(time); $month++; $year += 1900; open (INFILE, $f_mfg_desk); ($record);... or while () { chomp; my @newrow = split /\t/; # What does this below statement acutally mean? $header_data{$newrow[2]} = [ $newrow[3..18] ]; } close(INFILE); open (OUTFILE, ">$f_mfg_desk2"); # If I am sorting by this data, why does it delelte most of # the data? # Which data field is actually being used to sort? for my $key (sort keys %header_data) { for my $a (@{$header_data{$key}}) { print OUTFILE "$a\t"; } print OUTFILE "\n"; }