my $cmd = shift; my $interval = shift; my $path = shift; my $obj = new CustomModule2; `$cmd -P ALL $interval >> $path`; $SIG{INT} = \&signal_handler; $SIG{TERM} = \&signal_handler; sub signal_handler { ## uses the command output information and assigns them into arrays## my @pngnames = ( $obj->createGraph($path, $numsamples.. etc etc) ); $obj->writeHTML($path,$numsamples,@pngnames); }