sub mysecret { my ($t) = @_; unless( defined $t ) { # should probably die if undefined $t = time(); warn "secret called with no param: using '$t'"; } my $s = sha1_hex("mysaltforthesecret" . $t); warn "secret: ($t, $s)" if $DEBUG; return $s; }