in reply to signal handler in referenced subroutine

Err... I see a potential design flaw here! Killing a process when a file reaches a certain size or uptime does not make much sense, unless you can justify it with some major requirement, or maybe I didn't understand well...

TMBAWTDI! (There MUST Be Another Way To Do It!). What about this metacode:

sub writer_function { if((time - $^T <= $max_uptime) && ($output_size <= $max_size)) { # # Normal processing here # $output_size += $size_written; } else { # # Cleanup, then exit # } }

Sounds good?

-- TMTOWTDI

Replies are listed 'Best First'.
Re: Re: signal handler in referenced subroutine
by aijin (Monk) on Aug 04, 2001 at 00:07 UTC
    It's a little tough to explain.

    The module that I call deals with MIBs. If you've ever worked with MIBs you'll know that although there's a standard, it's often ignored, and you can end up in infinite loops (well, until your memory runs out).

    The writer function gets called for each line of output from the module function. If it's looping indefinately, it's going to keep calling the writer function. I'm not sure if I can kill the entire output function from the referenced writer function. If I can, your solution may just work.

    -aijin