Proc::ProcessTable::Match - Matches a Proc::ProcessTable::Process against a stack of checks.
Version 0.0.1
use Proc::ProcessTable::Match; use Proc::ProcessTable; use Data::Dumper; # looks for a kernel proc with the PID of 0 my %args=( checks=>[ { type=>'PID', invert=>0, args=>{ pids=>['0'], } },{ type=>'KernProc', invert=>0, args=>{ } } ] ); # hits on every proc but the idle proc %args=( checks=>[ { type=>'Idle', invert=>1, args=>{ } } ] ); my $ppm; eval{ $ppm=Proc::ProcessTable::Match->new( \%args ); } or die "New failed with...".$@; my $pt = Proc::ProcessTable->new; foreach my $proc ( @{$t->table} ){ if ( $ppm->match( $proc ) ){ print Dumper( $proc ); } }
This ininitates the object.
One argument is taken and it is a hashref with the key "checks". That value needs to contains a array of hashs of checks to run.
Every check must hit for it to beconsidered a match.
Each of these should always be defined.
This is the module to use to use to run the check.
The name is relative 'Proc::ProcessTable::Match::', so 'PID' becomes 'Proc::ProcessTable::Match::PID'.
This inverts inverts the returned value from the check.
This is a hash that will be pashed to the checker module's new method.
For any required keys, check the documents for that checker.
If it does not take any arguments, just pass a blank hash.
my %args=( checks=>[ { type=>'PID', invert=>0, args=>{ pids=>['0'], } },{ type=>'KernProc', invert=>0, args=>{ } } ] ); my $ppm; eval{ $ppm=Proc::ProcessTable::Match->new( \%args ); } or die "New failed with...".$@;
Checks if a single Proc::ProcessTable::Process object matches the stack.
One object is argument is taken and that is the Net::Connection to check.
The return value is a boolean.
if ( $ppm->match( $conn ) ){ print "It matched.\n"; }
Zane C. Bowers-Hadley, <vvelox at vvelox.net>
<vvelox at vvelox.net>
Please report any bugs or feature requests to bug-proc-processtable-match at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Proc-ProcessTable-Match. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-proc-processtable-match at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Proc::ProcessTable::Match
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
https://rt.cpan.org/NoAuth/Bugs.html?Dist=Proc-ProcessTable-Match
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Proc-ProcessTable-Match
CPAN Ratings
https://cpanratings.perl.org/d/Proc-ProcessTable-Match
Search CPAN
https://metacpan.org/release/Proc-ProcessTable-Match
Repository
https://gitea.eesdp.org/vvelox/Proc-ProcessTable-Match
This software is Copyright (c) 2019 by Zane C. Bowers-Hadley.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
To install Proc::ProcessTable::Match, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Proc::ProcessTable::Match
CPAN shell
perl -MCPAN -e shell install Proc::ProcessTable::Match
For more information on module installation, please visit the detailed CPAN module installation guide.