in reply to Deleting a columnheader

What is the purpose of this line in the code?
print $FILE4 "".<$FILE1>;

Replies are listed 'Best First'.
Re^2: Deleting a columnheader
by bluray (Sexton) on Oct 07, 2011 at 16:51 UTC

    It will make sure that I will have the columnheader of $FILE1. If I remove it, there will be no headers. I tried to replace that with this code:

    my @columnheadings=split(/\t/,<$FILE1>); @columnheadings=@columnheadings[map{$_}(0..4)]; print $FILE4 "@columnheadings\n";

    Then all the columnheaders were seen in the first cell when it was opened in spreadsheet.

      You were almost there. Just join the array back. And note that map{$_}(0..4) is just the same as 0..4 itself, so you can write:
      print {$FILE4} join("\t", (split /\t/, <$FILE1>)[0 .. 4]),"\n";
        Thanks Choroba, It is perfect now.