sdiff example_user_menu.htm pnDiagram_user_main.htm
####
####
####
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
# We need to gather some info from the user
# here for module name
print "Please enter your module name\n";
print "This would be the name of the directory of your module\n";
my $mname = ;
chomp($mname);
# Now we need to know where to look to make
# the changes to files on the system this
# will be our base directory to search through
print "Please enter your modules base directory\n";
print "Example would be /var/www/postnuke/modules/YOUR_MODULE/\n";
my $base = ;
chomp($base);
my $old_name = 'example';
my $old_name2 = 'Example';
find(\&wanted, $base);
sub wanted {
if ((-f $File::Find::name) && ($File::Find::name !~ m/\.bak/)) {
my $file = $File::Find::name;
(my $new = $file) =~ s/$old_name/$mname/;
rename($file, $new);
open(IN, $new) or die($!);
open(OUT, '>' . $file) or die($!);
while () {
s/$old_name/$mname/g;
s/$old_name2/$mname/g;
print OUT $_;
}
close(OUT);
close(IN);
}
}