[ale] OT: one for the Perl Guru's

Fletch fletch at phydeaux.org
Tue Apr 29 14:27:13 EDT 2003


>>>>> "Robert" == Robert L Harris <Robert.L.Harris at rdlg.net> writes:

    Robert>  Say I have an array containing the phrases "foo bar"
    Robert> "this one" and "one more here" named @IgnoreArray.  Then I
    Robert> have lines of text being read into 3 variables.  I want to
    Robert> do something like:

    Robert>   next if (grep(/@IgnoreArray/, $text));

    Robert> What's the best syntax for this.  I can make it work if I
    Robert> were to do a for loop instead of @IgnoreArray but that's
    Robert> visibly ugly to read.

OUTER:
while( $whatever ) {

  # set sources $foo, $bar, and $baz

  for( $foo, $bar, $baz ) {
    next OUTER if grep /$_/, @IgnoreArray;
  }

}


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 294-0820 (m)      |  scary questions." -- Jules                =(___)=
                      |                                               U
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list