my $code_file = '/tmp/myscript.cmds'; $SIG{HUP} = sub { unless ( -e $code_file ) { warn "Received HUP signal, but no command file."; return; } eval { require $code_file; unlink $code_file; }; if ( ! $@ ) { warn "Caught HUP signal and processed command file"; } else { warn "Caught HUP signal but unable to process commands: $@"; } }; #### > echo "$foo = 27" >> /tmp/myscript.cmds > killall -HUP perl