Zsdc wrote:
>
> Anthony J Segelhorst wrote:
>
> > I am working on script to kill a process if it have been running for 45
> > minutes or more.
> >
> > I am using a pstool called pslist to gather the data on the process.  This
> > out put looks like:
> > (...)
> >
> > I started to build my array by doing:
> >
> > @temparry = `"$lcf_tools\\pslist EXCEL"`;
> > foreach $temp (@temparray){
> >  ($name,$pid,$pri,$thd,$hnd,$Mem,$usertime,$kerneltime,$elapsedtime) =
> > split(" ",$temp);
>
> Maybe try:
>
>    /^EXCEL/ and @fields = split for `$lcf_tools/pslist EXCEL`;

This is the same as

  foreach ( `$lcf_tools/pslist EXCEL` ) {
    @fields = split if /^EXCEL/;
  }

but IMO less clear.

> Also, take a look at Proc::ProcessTable module on CPAN.

This module is for Unix processes. It looks like Anthony is on Windows
with backslashes in the path.

Cheers,

Rob



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to