while () { if (my @matches = $_ =~ /exp/) { print join "\t", @matches; } } #### while () { if (my @matches = $_ =~ /exp/) { my $line = join "\t", @matches; print $line; } }