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
tosub init { $SIG{CHLD} = ...; ... init code ... } { init() ... main code ... }
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 | |
by ahmad (Hermit) on May 26, 2010 at 10:36 UTC |