in reply to Creating a hash with key generated by a sub?

Note that your code here:

sub get_md5 { md5_hex("$secret" . "$_") };

uses two globals and would probably be better written to use parameters:

sub get_md5 { my($my_secret, $data) = @_; md5_hex($my_secret . $data); };