<p>I know that php has md5(), sha1(), and the hash() functions, but I want to create a hash using the MySQL PASSWORD() function.  So far, the only way I can think of is to just query the server, but I want a function (preferably in php or Perl) that will do the same thing without querying MySQL at all.</p>

<p>For example:</p>

<p>MySQL hash -> 464bb2cb3cf18b66</p>

<p>MySQL5 hash -> *01D01F5CA7CA8BA771E03F4AC55EC73C11EFA229</p>

<p>Thanks!</p>

Why do you want to use mysql password() function?
Even the Mysql documentation advises against this:
http://dev.mysql.com/doc/refman/5.0/en/encryption-functions.html#function_password
The PASSWORD() function is used by the authentication system in MySQL Server; you should not use it in your own applications
You can use md5() for example, wich is present in almost every programming language, php and perl included.