note
samtregar
This is very easy if you've got cygwin to give you a working shell, find and xargs. For example, to change from /usr/bin/perl to /usr/local/bin/perl I'd do something like (untested):
<p>
<code>find -name '*.pl' -o -name '*.cgi' | xargs perl -pi -e "s{^#!/usr/bin/perl}{#!/usr/local/bin/perl}"</code>
<p>
The -pi command-line switch tells Perl to do in-place editing and the -e specifies the code to on each line. If your filenames might have spaces in them you can add -print0 to the find call and -0 to the xargs call before perl.
<p>
If you want to do it all in Perl can use [cpan://File::Find] or something similar to find the files for you.
<p>
-sam
743170
743170