Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Delete line if REGEX == true

by neniro (Priest)
on Aug 07, 2005 at 09:35 UTC ( [id://481648]=note: print w/replies, xml ) Need Help??


in reply to Delete line if REGEX == true

Another way to directly remove unwanted lines is using Tie::File and greping those lines you want:
#!/usr/bin/perl use strict; use warnings; use Tie::File; my @text; tie @text, 'Tie::File', 'test_filter.txt' or die "Something went wrong: $!\n"; @text = grep { !/,,,,,/ } @text; untie @text; exit;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://481648]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 12:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found