It's cause you're only reading in the first part of the file. You probably want something more like:

Code:
use MIME::Base64 qw(encode_base64);
open(FILE, "/var/log/wtmp") or die "$!";

while (<FILE>) {
  $buf .= $_;
}

print encode_base64($buf);