This queue is for tickets about the Algorithm-Diff CPAN distribution.

Report information
The Basics

Nobody in particular
Brian.Eschner [...]

(no value)
Broken in:
(no value)
Fixed in:
(no value)

CC: <>, <>, "Eschner, Brian" <>
Subject: Enhanced code for Perl program to include -i -w switches
Date: Mon, 1 Aug 2011 12:47:12 -0400
To: <>
From: "Eschner, Brian" <>



Thanks for creating Algorithm-Diff. I’m playing with it to create a program to compare multiple files.


I’m glad I found the program which emulates the UNIX diff command. (Oh, how I miss working on a UNIX box…) But now I can use this program on my PC to compare files.


However, I wanted to compare the files but ignore differences due to Case and/or White-Space, so I modified the program. Please consider the revised program (attached) for inclusion in the next release of the Algorithm-Diff module.


The simple changes I’ve made to add the –i and –w switches are:


·         Update the “Usage” section (including adding the missing -q on the Usage: line)

·         Declare 2 new OPTion flags: $opt_i and $opt_w

·         Declare a new $compareRoutineRef variable to optionally point to the compareRoutine() function (defaults to undef)

·         Look for the new –i and –w switches, setting the $compareRoutineRef variable if found

·         Pass the $compareRoutineRef variable to the diff function

·         Add a line to print “Comparing files: $file1 & $file2…”  [This part can be removed if it would hurt existing functionality]

·         Declare the compareRoutine() function to modify the text to ignore white-space and/or change case to UpperCase as desired


I would be interested in hearing your response to my enhancements.


Many Thanks!

Brian D. Eschner
Reliability Engineer
Reliability & Maintainability Engineering
HTSI - Central Engineering
1110 Bayfield Dr.
Colorado Springs, CO 80906
Phone (719) 955-5772


Message body is not shown because sender requested not to inline it.

This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with to