Short version: I'm trying to pass an argument to a signal handler. When I do so, however, the handler runs as soon as the program is launched. Why is this happening, and how can I correct it?

Details: I have the following line in my code: `$SIG{ALRM} = \&timesup($number);`. The signal handler itself is:

```
sub timesup {
    my $num = shift;
    die "Time ran out.\nNumber was: $num\n"
}

```

When I run the program, it immediately runs the signal handler and dies with the specified message. I tested by generating a random value for $number just before the `$SIG{ALRM}` line. The swan song message on dying does print the random value, so I think the argument itself is being passed correctly. But the output is immediate: 

```
bassoon:$ ./myscript.pl

Time ran out.
Number was: 4

```

If I take away the argument and simply have `$SIG{ALRM} = \&timesup;`, then the program works as expected. However, in that case I have no way of passing the argument to the subroutine, and have to use a global, which I'd rather not do. 

What am I doing wrong? Thanks for your help.