my @matches = get_matches($file); sub get_matches { my $file = shift; return unless (-e $file && -r _); local *FH; sysopen FH, $file, O_RDONLY; flock FH, 8; map { chomp; qr/$_/ } ; }