Even better, it's available online. Not only does it have an example on how to decode the binary format of wtmp files with unpack(), but it even has an example on using the 'last' command from within Perl.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |