@results = grep( /^$line[3]/, @raw_data); #### 1235 some text data 784783 some other data #### my $search_for = "text"; my $re = qr/^(\d+)\s+\Q$search_for\E/; open D,"data.txt" or die "Cant open file: $!"; while () { /$re/ or next; print "$1\n"; } close D; #### -- Joost downtime n. The period during which a system is error-free and immune from user input.