Perl

How to search duplicate files within two directories?

#!/usr/bin/perl
use strict;
use warnings;

# findDupeFiles:
# This script attempts to identify which files might be duplicates.
# It searches specified directories for files with a given suffix
# and reports on files that have the same MD5 digest.
# The suffix or suffixes to be searched for are specified by the first
# command-line argument - each suffix separated from the next by a vertical bar.
# The subsequent command-line arguments specify the directories to be searched.
# If no directories are specified on the command-line,
# it searches the current directory.

How to search and replace in files using Perl?

PERL - Practical extraction and reporting language is best suited for replacing text using regular expression in a large amount of files. To replace text in the files, just browse to directory in command prompt where the files resides and issue the following command:

perl -pi.bak -e 's/Find/Replace/g' *.html

perl -pi.bak -e "s/re[g]ex/regular expression/gi" *.html