in reply to elementary hash, STDIN questions
Here is how I would do it :-
Pass a list of files you want changed in on the command line - this will edit them in place (the -i flag) saving the old ones with a .bak extension.#!/usr/bin/perl -w -p -i.bak use strict; my $kill = join "|", qw{ wahwah blahblah yadayada }; while (<>) { s/$kill//go; # remove unwanted strings s/^\s+//g; # blank lines }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jcwren) RE: Re: elementary hash
by jcwren (Prior) on Sep 12, 2000 at 02:03 UTC | |
|
RE: Re: elementary hash
by chromatic (Archbishop) on Sep 12, 2000 at 03:01 UTC | |
by tilly (Archbishop) on Sep 12, 2000 at 04:10 UTC | |
|
RE: (2) elementary hash (uninitialized value...)
by ybiC (Prior) on Sep 12, 2000 at 01:57 UTC | |
by adamsj (Hermit) on Sep 12, 2000 at 02:22 UTC |