Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^7: Search and delete lines based on string matching

by imp (Priest)
on Mar 13, 2007 at 15:17 UTC ( #604567=note: print w/replies, xml ) Need Help??


in reply to Re^6: Search and delete lines based on string matching
in thread Search and delete lines based on string matching

For deletion you would use this pattern, sorry:
while (my $line = <$pattern_fh>) { chomp $line; # Use quotemeta to allow for items like A[0] push @tokens, quotemeta($line); } my $pattern = '^(?:' . join('|', @tokens) . ')[^a-zA-Z]*$'; print "Search pattern: $pattern\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://604567]
help
Chatterbox?
LanX better!
[atcroft]: .oO(Plus it was a little slow for a few minutes, at least... ;) )

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2018-02-24 20:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (311 votes). Check out past polls.

    Notices?