in reply to Is there a Perl version of UNIX "cmp" ?

File::Compare
#!/usr/bin/perl #generally use File::Compare available in Perl5.8 print cmp_file(@ARGV) ? "equal\n" : "not equal\n"; ################# use constant BUF_SIZE => 4096; sub cmp_file { my ( $f1, $f2 ) = @_; open my $h1, $f1 or die "gah $f1: $!"; open my $h2, $f2 or die "gah $f2: $!"; binmode $h1; binmode $h2; my ( $buf1, $buf2 ); my $equal = 0; while ( read $h1, $buf1, BUF_SIZE ) { read $h2, $buf2, BUF_SIZE; last unless $equal = ( $buf1 eq $buf2 ); } return $equal and eof $h2; }

I'm not really a human, but I play one on earth Remember How Lucky You Are