JupiterHost.Net <mailto:[EMAIL PROTECTED]> wrote:
 
: Thanks for catching my misstatement :)

    Thanks for finally making one. :)


: #!/usr/bin/perl
: 
: use strict;
: use warnings;
: 
: open my $file1_fh, '<', 'file1' or die "file1 open failed: $!";
: 
: open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";
: my @match_list = <$file2_fh>;
: close $file2_fh;
: 
: while(<$file1_fh>) {
:      my $line = $_;
:      chomp $line;
: 
:      for my $match_against (@match_list) {
:          chomp $match_against;
:          print "Got the string\n" if $line =~ m{$match_against}xms;
:      }
: }
: 
: close $file1_fh;

    Yes, this is the option the OP chose in a message up thread
from here.

    The only thing I would change is the repeated chomping of
the matches. On second thought I'll also complain about that 
5-space initial indent. :)

open my $file2_fh, '<', 'file2' or die "file2 open failed: $!";
chomp( my @match_list = <$file2_fh> );
close $file2_fh;

        .
        .
        .

     for my $match_against (@match_list) {
         print "Got the string\n" if $line =~ m{$match_against}xms;
     }

    Why the {}xms options on the regex? We aren't messing with $/,
so there shouldn't be any multi-line problems. Is it just a
precaution or is their some other reason?

    Christmas*, perhaps? :)


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
254 968-8328


* Christmas is sometimes referred to as "Xmas" in my country.




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to