in reply to Sorting Tab file

If you really wanted to change split, you could use an array slice like ar0n demonstrated, but applying it directly to split instead of @Fld ...

my @Fld = ( split /\t/ )[0,4]; my $col = 0; foreach my $token (@Fld) {

Another way, is to loop over the indicies you want...

my @fld_no = qw( 0 4 ); my $row = 0; # ... foreach my $idx (@fld_no) { $worksheet->write($row, $col, $fld[$idx]);

    --k.