in reply to Matching and removing a line from a file
split (/, /,$exclude) ^ | missing
I'm assuming $exclude comes from a file or something? If not, the following would be better than creating a string and splitting it:
my @excludes = ( $input{'FName'}, $input{'LName'}, $input{'county'} );
Also,
/$entry/
should be
/^\Q$entry\E\z/
or
$_ eq $entry
\Q..\E convert the text to a regexp pattern. ^..\z makes sure $entry is not just part of the $_.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Matching and removing a line from a file
by AnomalousMonk (Archbishop) on Dec 10, 2008 at 03:57 UTC | |
by ikegami (Patriarch) on Dec 10, 2008 at 05:51 UTC |