perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mer...@stonehenge.com (Randal L. Schwartz)
Subject Re: mixing cgi-bin & mod_perl
Date Thu, 20 Dec 2001 23:16:48 GMT
>>>>> "Luciano" == Luciano Miguel Ferreira Rocha <strange@nsk.yi.org>
writes:

Luciano> I would just use:

Luciano> find . -type f -print0 | xargs -0 perl -spi -e 's/cgi-bin\/some_scr.pl/mod-perl\/some_scr.pl/g;'

Ewww.  Why two processes?

    use File::Find;
    @ARGV = ();
    find sub { push @ARGV, $File::Find::name if -f }, ".";
    $^I = ""; # or ".bak"
    while (<>) {
      s/cgi-bin(\/some_scr.pl)/mod-perl$1/g;
      print;
    }

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Mime
View raw message