Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

testcmp -- compare two files line-by-line

testcmp -- compare two files line-by-line


NAME

testcmp -- compare two files line-by-line


SYNOPSIS


    $is_diff = testcmp($file1, $file2);

or


    $is_diff = testcmp({-cmplines => \&mycmp}, $file1, $file2);

DESCRIPTION

Compare two text files line-by-line and return 0 if they are the same, 1 if they differ. Each of $file1 and $file2 may be a filenames, or a filehandles (in which case it must already be open for reading).

If the first argument is a hashref, then the -cmplines key in the hash may have a subroutine reference as its corresponding value. The referenced user-defined subroutine should be a line-comparator function that takes two pre-chomped text-lines as its arguments (the first is from $file1 and the second is from $file2). It should return 0 if it considers the two lines equivalent, and non-zero otherwise.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy