Portscout is a project mainly written in Perl, it's free.
MySQL patch tree of the FreeBSD ports tree version scanner
Please see 'perldoc portscout' for usage instructions.
Don't forget to review UPDATING if you are upgrading from a previous release.