[ale] OT: one for the Perl Guru's
Jerry Yu
z.yu at voicecom.com
Tue Apr 29 13:49:52 EDT 2003
not sure it'd be the best, here is how I deals with it
my $toIgnoreExpr = join '|', @IgnoreArray;
next if ($text =~ /$toIgnoreExpr/i );
'grep' operates on a list/array.
On Tue, 29 Apr 2003, Robert L. Harris wrote:
#
#
# Say I have an array containing the phrases "foo bar" "this one" and
#"one more here" named @IgnoreArray. Then I have lines of text being
#read into 3 variables. I want to do something like:
#
# next if (grep(/@IgnoreArray/, $text));
#
#What's the best syntax for this. I can make it work if I were to do a
#for loop instead of @IgnoreArray but that's visibly ugly to read.
#
#
#:wq!
#---------------------------------------------------------------------------
#Robert L. Harris | PGP Key ID: E344DA3B
# @ x-hkp://pgp.mit.edu
#DISCLAIMER:
# These are MY OPINIONS ALONE. I speak for no-one else.
#
#Diagnosis: witzelsucht
#
#IPv6 = robert at ipv6.rdlg.net http://ipv6.rdlg.net
#IPv4 = robert at mail.rdlg.net http://www.rdlg.net
#
Jerry Z. Yu +1-404-487-8544 (O)
systems engineer z.yu at voicecom.com
is support, voicecom, llc www.voicecom.com
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale
More information about the Ale
mailing list