in reply to Re: Re: Re: Nested foreach
in thread Nested foreach

foreach my $line (@words) { $line =~ tr/A-Z/a-z/; foreach my $ignore (@ignore) { $line =~ s/\b$ignore\b//g; } }
doesn't change the outcome of the program either :( No words are ignored but you were right, I need the //g :)

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Nested foreach
by Thelonius (Priest) on Apr 25, 2003 at 19:31 UTC
    Oh, I didn't notice that at the top, you need to change
    my @ignore = qq(a and the this i me us our ok abc);
    to
    my @ignore = qw(a and the this i me us our ok abc);
    I.e. change qq to qw.
      Thanks so much!! After looking at that I slapped myself in the forhead for making a mistake like that, I think this was my major problem all along (oh, I feel stupid). I was wondering why qq() didn't show up as an error but it turns out that's a real command too, go figure :)

      Thanks for your help Thelonius and every other monk who hasn't slapped themselves into the next cyberworld from my mistakes.