Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
foreach (@banned_channels) {
if ($channels =~ /$_/i) {
IRC::print "match: $_";
}
}
The @banned_channels are loaded from a file (I've verified
that this is working fine). I've also made sure that the
values of $channel and $_ are both correct on each
iteration of the loop. Still, no matches are being made.
Am I making some newbie mistake in my use of $_ as a regexp?
Oh, if it helps the value of $channels usually
looks something like "#help #blah #irc". I suppose I could
also post the full source code if the problem seems to be
elsewhere. Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using m// while iterating through an array
by chromatic (Archbishop) on Sep 22, 2000 at 08:19 UTC | |
|
Re: using m// while iterating through an array
by japhy (Canon) on Sep 22, 2000 at 15:20 UTC | |
|
Re: using m// while iterating through an array
by Anonymous Monk on Sep 22, 2000 at 09:54 UTC |