#!/usr/bin/perl -w

# Title: Quick script to get the system processes
# Reference:  Oreilly, Perl for Sysadmins, pg 116. 
#

# I had to install this module:  perl -MCPAN -e 'install Proc::ProcessTable'
use Proc::ProcessTable ;

# Create a Proc::ProcTable::Process object
$server = Proc::ProcessTable->new;

# Assign the table method of the object to a variable.
$server_proctable = $server->table();

# initialize the counter
$a=0;
for (@$server_proctable){	
	# print Pid's and UID's
	#print $_->pid."\t". getpwuid($_->uid)."\n";
	
	# just get the count;
	$a++

}
print "Total of $a processes\n";
