You don't have warnings turned on, which means you're not going to be warned about all the undefined variables on this line:
my $sig_msg = "$email::$name::$nick::$ts::$t"; # this is the message
+to be signed.
Perl reads that as:
my $sig_msg = $email:: . $name:: . $nick:: . $ts:: . $t;
because "::" is the package separator an it is legal to have a variable with an "empty" name like
$foo:: (the "" scalar in package 'foo'). I suggest replacing the line with
my $sig_msg = join "::", $email, $name, $nick, $ts, $t;
and turning warnings on, too. Apart from this, I don't know what to tell you about your problem.