#!/usr/bin/perl -w use 5.016; use strict; # 1089209.pl my @int_descriptions; # OP suggests the seeker knows how to obtain the array # so, here's a test case without annoying the router @int_descriptions = ( 'foo.baz 12.247.62.7 20140608:1629', 'royal.com 1.11.617.251 20140608:1457', 'harvard.edu 1.1.217.0 20140608:1454', 'smithbarney.fin 195.7.168.2 20140608:1454', 'pomono.edu 93.16.124.5', 'yale.edu 58.3.179.6', 'etc.org 9.11.14.0 20140608:1320', ); open my $fh, '<', 'foo1089209.txt' or die "Can't open file for read, $!"; my @foo = <$fh>; for my $foo(@foo) { chomp $foo; say " *** Testing for matches to \$foo: $foo ***"; for (@int_descriptions) { my $int = qr/$_/; if ( $int =~ /$foo/ ) { say "\t \$foo: $foo found in \$int: $int"; } } # next; }