in reply to Shell trick to edit many files with perl
use File::Find; my @new_list; find sub { push @new_list, $File::Find::name if --- some criterion here ---; }, @ARGV; @ARGV = @new_list; $^I = ".bak"; while (<>) { s/old/new/g; print; }
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Shell trick to edit many files with perl
by jepri (Parson) on May 23, 2001 at 20:09 UTC |