#!/usr/bin/perl -w
use warnings;
use strict;
use File::Find;
use File::Copy;
my $prevdir;
my $path = $ARGV[0];
chdir($path) or die "Can\'t chdir to $path";
print "Copying index.html file...\n";
find(\&CopyContent, $path);
sub CopyContent
{
my $file = $File::Find::name;
my $dir = $File::Find::dir;
#check if file is a file (not a directory) and a Text file
if (-f $file && -T $file)
{
$dir =~ s/$path//g;
my $currdir = $dir;
if ($currdir ne $prevdir) {
print "Processing directory: \.$currdir \n";
my $prevdir = $currdir;
}
### manipulate file code goes here....
}
}
Bookmarks