#!/usr/bin/perl use strict; use warnings; use diagnostics; my $file = $ARGV[0]; open(my $fh, '<', $file) or die "$file: $!"; my $query; while (<$fh>) { if (/^Query=\s(\S+)/) { $query = $1; } if (defined($query) && /^>(\S+)/) { print "$query\t$1\n"; undef $query; } }
In reply to Re: Help with regex
by trizen
in thread Help with regex
by rocketperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |