Import OpenSSL-0.9.8i.
[dragonfly.git] / crypto / openssl-0.9.7d / util / perlpath.pl
bloba1f236bd9843cf69490c72c532129f9ced4d9d0a
1 #!/usr/local/bin/perl
3 # modify the '#!/usr/local/bin/perl'
4 # line in all scripts that rely on perl.
7 require "find.pl";
9 $#ARGV == 0 || print STDERR "usage: perlpath newpath (eg /usr/bin)\n";
10 &find(".");
12 sub wanted
14 return unless /\.pl$/ || /^[Cc]onfigur/;
16 open(IN,"<$_") || die "unable to open $dir/$_:$!\n";
17 @a=<IN>;
18 close(IN);
20 if (-d $ARGV[0]) {
21 $a[0]="#!$ARGV[0]/perl\n";
23 else {
24 $a[0]="#!$ARGV[0]\n";
27 # Playing it safe...
28 $new="$_.new";
29 open(OUT,">$new") || die "unable to open $dir/$new:$!\n";
30 print OUT @a;
31 close(OUT);
33 rename($new,$_) || die "unable to rename $dir/$new:$!\n";
34 chmod(0755,$_) || die "unable to chmod $dir/$new:$!\n";