The next step: How do you remove any array element that exactly matches any of 'fee' 'fie' 'foe'?
Question: How would you remove all array elements that match the above pattern anywhere in the string, so that the final output will be foo fum?c:\@Work\Perl\monks>perl -wMstrict -le "my @ra = qw(foo fee efie fiee efiee foe fum); print qq{before: (@ra)}; ;; my $rx_fee_fie_foe = qr{ \A f [eio] e \z }xms; ;; @ra = grep !m{ $rx_fee_fie_foe }xms, @ra; print qq{after: (@ra)}; " before: (foo fee efie fiee efiee foe fum) after: (foo efie fiee efiee fum)
Please see perlre, perlretut, and perlrequick.
Give a man a fish: <%-{-{-{-<
In reply to Re: Removing a string-element from an array of strings
by AnomalousMonk
in thread Removing a string-element from an array of strings
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |