while (<>) { chomp; my @fields = split /\t/; for ( splice(@fields, 3) ) { print(join("\t", @fields, $_), "\n"); } } #### while (<>) { (my $common, $_) = /^((?:[^\t]*\t){3})(.*)/; for ( split /\t/ ) { print("$common\t$_\n"); } }