Blockchain command line tools I was under the assumption that the bitcoind server allowed you to query the blockchain and run commands like bitcoind getbalance on any address. I'm finding out that you may query addresses in your wallet. Is this correct?

What is required to query the blockchain with commands like think locally without the need for external API's? 

My intention is to use a Perl script to get account balances.
Bitcoin at the protocol level, the Bitcoin Core implementation and its wallet implementation do not have a concept of "address balance". The protocol only has a notion of unspent transaction outputs ("coins") with a particular value and script to limit who can spend it. You can reasonably define the balance of an address as the sum of the values of all unspent transaction outputs with a script that can be spent using the key corresponding to that address, but the core implementation has no need for this.

The wallet doesn't track address balances either - it considers the pool of coins the entire wallet can spend, and keeps track of their total value. As for privacy of the system (not just yours) the recommendation is to simply use a different address for every incoming transaction, there is little use for per-address tracking either. The next release (0.10) will likely have support for watch-only wallets, which allow adding addresses to the wallet without the corresponding private key, allowing tracking of arbitrary sets of coins, but still not aggregated by address.

There are external tools that can do efficient querying of such aggregated data from the blockchain, like ABE and Insight.