#!/usr/bin/perl use strict; my $stuff_cmd = 'sleep 10'; my $cam_fh; my $cam_pid = open($cam_fh, "$stuff_cmd|"); print "cmd running: $cam_pid\n"; sleep 1; print "killing cmd: $cam_pid\n"; while ((my $count = kill -9, $cam_pid) != 1) { print "It's alive!!!!!\n"; sleep 1; } print "cmd closed off\n"; close($cam_fh); print "dead and buried!\n"; exit 0;