Monday, July 18, 2011

Compare two files

use File::Compare;

# Function Name : compareFile
# Input : Two files to compare.
# Output : Pass or Fail.
# Description : This function will compare two given files. If both files are same then it will return Pass
# else it will return Fail.
#
sub compareFile($$)
{
my ($file, $exp_file) = @_;

$file = convertSlash($file);
$exp_file = convertSlash($exp_file);

my $result = "";
if (compare($file, $exp_file) == 0)
{
$result = "Pass";
}
else
{
$result = "Fail";
}

return $result;
}

No comments:

Post a Comment