Made signal variables local as suggested by Perl::Critic.