in reply to Doing the right thing by perlcritic

(<pre> shouldn't be used here. Use <p> to start paragraphs, <c>..</c> around code, data and outputs)

Are you saying the following is no good for some reason?

sub trap_signals { local $SIG{CHLD} = \&handler; : }

It seems quite odd to set $SIG{CHLD} in a sub if you want it to have a global effect. But let's say it is a big init function, then you could either silence the critic (since the global effect is desired) or change

sub init { $SIG{CHLD} = ...; ... init code ... } { init() ... main code ... }
to
sub main { ... main code ... } { local $SIG{CHLD} = ...; ... init code ... main(); }

Replies are listed 'Best First'.
Re^2: Doing the right thing by perlcritic
by horrendo (Sexton) on May 26, 2010 at 04:34 UTC
    (Sorry about the <pre> tag. I saw it was 'approved' and was just being lazy)

    Thanks for such a quick response. I'll take on your suggestion.

    Cheers,

    H

      As a registered user, You still can fix it yourself and switch the <PRE> tags to <P>