This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor File::DosGlob to avoid an unescaped { in a regex.
[perl5.git] / lib / File / Compare.pm
index 9cf922b..05e1c41 100644 (file)
@@ -1,23 +1,22 @@
 package File::Compare;
 
-use 5.6.0;
+use 5.006;
 use strict;
 use warnings;
 our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Too_Big);
 
 require Exporter;
-use Carp;
 
-$VERSION = '1.1002';
+$VERSION = '1.1006';
 @ISA = qw(Exporter);
 @EXPORT = qw(compare);
 @EXPORT_OK = qw(cmp compare_text);
 
 $Too_Big = 1024 * 1024 * 2;
 
-sub VERSION {
-    # Version of File::Compare
-    return $File::Compare::VERSION;
+sub croak {
+    require Carp;
+    goto &Carp::croak;
 }
 
 sub compare {
@@ -39,7 +38,7 @@ sub compare {
     } elsif (ref(\$from) eq 'GLOB') {
        *FROM = $from;
     } else {
-       open(FROM,"<$from") or goto fail_open1;
+       open(FROM,"<",$from) or goto fail_open1;
        unless ($text_mode) {
            binmode FROM;
            $fromsize = -s FROM;
@@ -53,7 +52,7 @@ sub compare {
     } elsif (ref(\$to) eq 'GLOB') {
        *TO = $to;
     } else {
-       open(TO,"<$to") or goto fail_open2;
+       open(TO,"<",$to) or goto fail_open2;
        binmode TO unless $text_mode;
        $closeto = 1;
     }
@@ -171,8 +170,8 @@ is basically equivalent to
 
 =head1 RETURN
 
-File::Compare::compare return 0 if the files are equal, 1 if the
-files are unequal, or -1 if an error was encountered.
+File::Compare::compare and its sibling functions return 0 if the files
+are equal, 1 if the files are unequal, or -1 if an error was encountered.
 
 =head1 AUTHOR