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); };
In reply to Re: Creating a hash with key generated by a sub?
by gaal
in thread Creating a hash with key generated by a sub?
by smullis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |