my @vars = (undef, $5, $9, $11, $13, $15, $17, $19, $7, $1);
####
use strict;
use warnings;
my $file2 = <) {
next if $line !~ /\S+\s+run\d+_sub\d+_event(\d+)\s+(.*)/;
my ($event, $tail) = ($1, $2);
my @params = split /\s+/, $tail;
open my $DATA2, '<', \$file2 or die "Cannot open file2";
while (my $line2 = <$DATA2>) {
next if $line2 !~ /\S+\s+(\S+)\s+run\d+_sub\d+_event(\d+)/;
print "$event $params[1] $2\n" if $params[2] == $1 && $params[3] == $2;
}
close $DATA2;
}
__DATA__
00001 run1_sub1_event1 1 2 3 4 5 6 7
####
1 2 4