Diff for /db/prgsrc/changecities.pl between versions 1.1 and 1.2

version 1.1, 2000/10/17 15:05:48 version 1.2, 2000/10/17 15:33:46
Line 16  C<tour=oldcity> by C<tour=newcity> for e Line 16  C<tour=oldcity> by C<tour=newcity> for e
   
 in the ChangeLog  in the ChangeLog
   
 =back 4  =over 4
   
 =item B<-c> ChangeLog  =item B<-c> ChangeLog
   
Line 26  Location of the ChangeLog file Line 26  Location of the ChangeLog file
   
 Directory of html files  Directory of html files
   
 =over  =back
   
 =head1 AUTHOR  =head1 AUTHOR
   
Line 36  Boris Veytsman Line 36  Boris Veytsman
   
 =cut  =cut
   
       use strict;
   use vars qw($opt_c $opt_d);
   use Getopt::Std;
   
   getopts('c:d:') or die "Wrong arguemnts";
   open (CHANGELOG, $opt_c) or die "Cannot open ChangeLog $opt_c";
   chdir $opt_d or die "Cannot chdir to $opt_d";
   while (<CHANGELOG>) {
       chomp;
       next unless (/->/);
       m/^\s*(\S*)\.txt\s*->\s*(\S*)\.txt/ or print "Bad line: $_";
       my $oldname=$1;
       my $newname=$2;
       print "Changing $oldname to $newname\n";
       open(FILES, "grep -l \'tour=$oldname\' *.html|");
       while(<FILES>) {
           chomp;
           my $file = $_;
           print "CONVERTING $file.";
           `perl -iorig -p -e 's/tour=$oldname/tour=$newname/g' $file`;
           print "..\n";
       }
   }
   

Removed from v.1.1  
changed lines
  Added in v.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>