lib/App/SeismicUnixGui/misc/PID.pm untested

filter: Statementstmt 0.0% 0 / 17 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 30 CC 2 SCAR 11.5
CC
2
Cov
0%
any
6.0
suxgraph
2.0
suximage
2.0
CRAP 3.1
1 package App::SeismicUnixGui::misc::PID;
2  
3 use Moose;
4 our $VERSION = '0.0.1';
5  
6 =head2 sub PID
7
8 collects PIDs associated with running program
9  
10 =cut
11  
12 =pod
13  
14 B<
15 track processes by PID
16 Debug with:
17 print("ref_PID in PID.pm s: @out \n\n");
18 >
19 =cut
20  
21 sub suxgraph {
22  
23 my @out = `ps -ef | grep 48/bin/xgraph | awk '{print \$2}'`;
24  
25 return ( \@out );
26 }
27  
28 sub suximage {
29  
30 my @out = `ps -ef | grep 48/bin/ximage | awk '{print \$2}'`;
31  
32 return ( \@out );
33 }
34  
35 sub xgraph {
36  
37 my @out = `ps -ef | grep 48/bin/xgraph | awk '{print \$2}'`;
38  
39 return ( \@out );
40 }
41  
42 sub ximage {
43  
44 my @out = `ps -ef | grep 48/bin/ximage | awk '{print \$2}'`;
45  
46 return ( \@out );
47 }
48  
49 =head2 sub any
50  
51 any other program
52  
53 Debug with:
54 print("inputs are $self,$program \n\n");
55 print("this is $this \n\n");
56  
57 =cut
58  
59 sub any {
60 my ( $self, $program ) = @_;
61  
62 if ( defined($program) ) {
63 my $this = $program;
64 my @out = `ps -ef | grep 48/bin/$this | awk '{print \$2}'`;
65  
66 return ( \@out );
67 }
68 }
69  
70 1;