while( my $line = ) { # get your columns my @fields = split( /\t/, $line ); doWhatYouWantWith( $fields[0], $fields[1] ); # recompose your line from the modified columns # with a tab separator print join( "\t", @fields ); }