Skip Menu |
 

This queue is for tickets about the Perl-Dist-Strawberry CPAN distribution.

Report information
The Basics
Id: 108186
Status: new
Priority: 0/
Queue: Perl-Dist-Strawberry

People
Owner: Nobody in particular
Requestors: phillip73uk [...] googlemail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



MIME-Version: 1.0
X-Spam-Status: No, score=-2.698 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
X-Spam-Flag: NO
X-Virus-Checked: Checked
Content-Type: multipart/mixed; boundary="089e01176cad83705705234ffecb"
Message-ID: <CADUV455rzH0F+QnxQY7aKuKOn0mF7jwN0kEKA=VohzYou+Qjjg [...] mail.gmail.com>
X-Received: by 10.50.43.170 with SMTP id x10mr2150224igl.3.1446201362941; Fri, 30 Oct 2015 03:36:02 -0700 (PDT)
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -2.698
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 451992400FD for <cpan-bug+Perl-Dist-Strawberry [...] hipster.bestpractical.com>; Fri, 30 Oct 2015 06:36:12 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hliHZiWA0TUT for <cpan-bug+Perl-Dist-Strawberry [...] hipster.bestpractical.com>; Fri, 30 Oct 2015 06:36:10 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id C857E24008F for <bug-Perl-Dist-Strawberry [...] rt.cpan.org>; Fri, 30 Oct 2015 06:36:09 -0400 (EDT)
Received: (qmail 2440 invoked by alias); 30 Oct 2015 10:36:08 -0000
Received: from mail-ig0-f171.google.com (HELO mail-ig0-f171.google.com) (209.85.213.171) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 30 Oct 2015 03:36:06 -0700
Received: by igbdj2 with SMTP id dj2so8005643igb.1 for <bug-Perl-Dist-Strawberry [...] rt.cpan.org>; Fri, 30 Oct 2015 03:36:03 -0700 (PDT)
Received: by 10.64.224.241 with HTTP; Fri, 30 Oct 2015 03:36:02 -0700 (PDT)
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] googlemail.com
Delivered-To: cpan-bug+Perl-Dist-Strawberry [...] hipster.bestpractical.com
Subject: file::compare bug when comparing files in another directory
Return-Path: <phillip73uk [...] googlemail.com>
X-RT-Mail-Extension: perl-dist-strawberry
X-Original-To: cpan-bug+Perl-Dist-Strawberry [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=a2SURxt0Nmb9eOBPfPv4rO31pyjEuayhgaefc6DrzTo=; b=CqwsTvRD9b+rlfYlDps+rT+V6qCtGLBB0jPtohAKHWgVKsTAObQhHg1cOSTMDSA4z4 VckDfPX9BU1RebgDGHuAYAIbgD1pjR9sf4tXKPUQmQyaPuM2xyrnKvey2VUtwbDbhkTX U4T5b5dCUxjpyDohZY40C8/jCCwXmrNf0d9WzAMfY+OVcQPyDOMi6zO9B1I8PS9SjbO1 6WMe1od/j6xyWdr2l4EFpI8JFIW1kjNUyVwi3vQsvgLri8ew2vtuQEiJKSZelUccBYIC 2b6XQzGn+DLi/oWZU1kq/E1RPiBXyzjAl/KZS/mpzVakyEtaVgafktMyUhy7U9iSgfLJ vyWA==
Date: Fri, 30 Oct 2015 10:36:02 +0000
X-Spam-Level:
To: bug-Perl-Dist-Strawberry [...] rt.cpan.org
From: Phillip George <phillip73uk [...] googlemail.com>
X-RT-Interface: Email
Content-Length: 0
Content-Type: multipart/alternative; boundary="089e01176cad83705105234ffec9"
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 2424
Download (untitled) / with headers
text/plain 2.3k
Hi , Firstly, Thanks for strawberry perl it's making my life alot easier. Think I may have found a bug within the File::Compare module. Basically I get different results with File::Compare::compare_text when comparing files in same directory as script to when comparison files are in another directory. To test script you will have to create a directory ''anotherDirectory" which is below the working script directory. use File::Compare; use FileHandle; use File::Compare 'cmp'; sub munge($) { my $line = $_[0]; for ($line) { s/^\s+//; # Trim leading whitespace. s/\s+$//; # Trim trailing whitespace. } return uc($line); } sub Convert_Upper{ my $in = $_[0]; for ($in) { s/^\s+//; # Trim leading whitespace. s/\s+$//; # Trim trailing whitespace. } my $out = uc($in); return uc($in); } sub CompareFiles{ my ($First_line,$Second_line) = @_; print "CompareFiles..1st...$First_line\n"; print "CompareFiles...2nd...$Second_line\n"; $First_line = &Convert_Upper($First_line); $Second_line = &Convert_Upper($Second_line); print "CompareFiles..1st..compare lines...$First_line.\n"; print "CompareFiles..2nd..compare lines...$Second_line.\n"; if($First_line eq $Second_line){ return 0; } else { return 1; } } # # create 3 files: file1.txt and file2.txt are identical but ileDiff.txt is different to the others # #below code works..... print "compare files that are in same directory as script \n"; print "\n"; printf "file1 and fileDiff are %s.\n", compare("file1.txt","fileDiff.txt") ? "different" : "identical"; if ( File::Compare::compare_text("file1.txt","file2.txt", sub{ CompareFiles(@_) } )) { print "sub....file1 and file2 are different.\n"; } else{ print "sub...file1 and file2 are identical.\n"; } # # but now place files in another directory...as below....this doesn't work.....I've also tried file handles ? # print ".......\n"; print "compare files that are in another directory as script \n"; print "\n"; printf "file1 and fileDiff are %s.\n", compare(".\anotherDirectory\file1.txt",".\anotherDirectory\fileDiff.txt") ? "different" : "identical"; if ( File::Compare::compare_text(".\anotherDirectory\file1.txt",".\anotherDirectory\file2.txt", sub{ CompareFiles(@_) } )) { print "sub....file1 and file2 are different.\n"; } else{ print "sub...file1 and file2 are identical.\n"; }
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 5660
X-Attachment-ID: f_igdir1b30
Content-Type: application/octet-stream; name="Bug_File_compare.pl"
Content-Disposition: attachment; filename="Bug_File_compare.pl"
Content-Transfer-Encoding: base64
Content-Length: 2192
Download Bug_File_compare.pl
text/x-perl 2.1k

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



This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.