#!/usr/bin/perlusestrict;usewarnings;useUnix::Lsof;useUnix::PID;my$pid=Unix::PID->new();my$red5\_pid=$pid->get\_pidof(‘search for a process by this string’); unless($red5_pid){print’0′; exit;}my($output,$error)=lsof(‘-p’, $red5_pid, ‘-w’ ); my@vals=values%{$output};printscalar@{$vals[0]{files}};