X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/c1b16575eb03bf1d5b9bf6b20b2765d6375a227d..d569369663d5f1104f258f47a91ede9f4feb155e:/lib/File/Compare.pm diff --git a/lib/File/Compare.pm b/lib/File/Compare.pm index eba17c3..7418fe6 100644 --- a/lib/File/Compare.pm +++ b/lib/File/Compare.pm @@ -6,15 +6,19 @@ use warnings; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Too_Big); require Exporter; -use Carp; -$VERSION = '1.1003'; +$VERSION = '1.1005'; @ISA = qw(Exporter); @EXPORT = qw(compare); @EXPORT_OK = qw(cmp compare_text); $Too_Big = 1024 * 1024 * 2; +sub croak { + require Carp; + goto &Carp::croak; +} + sub compare { croak("Usage: compare( file1, file2 [, buffersize]) ") unless(@_ == 2 || @_ == 3); @@ -34,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; @@ -48,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; } @@ -166,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