Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

proc::processtable(3pm) [debian man page]

ProcessTable(3pm)					User Contributed Perl Documentation					 ProcessTable(3pm)

NAME
Proc::ProcessTable - Perl extension to access the unix process table SYNOPSIS
use Proc::ProcessTable; $p = new Proc::ProcessTable( 'cache_ttys' => 1 ); @fields = $p->fields; $ref = $p->table; DESCRIPTION
Perl interface to the unix process table. METHODS
new Creates a new ProcessTable object. The constructor can take the following flags: enable_ttys -- causes the constructor to use the tty determination code, which is the default behavior. Setting this to 0 diables this code, thus preventing the module from traversing the device tree, which on some systems, can be quite large and/or contain invalid device paths (for example, Solaris does not clean up invalid device entries when disks are swapped). If this is specified with cache_ttys, a warning is generated and the cache_ttys is overridden to be false. cache_ttys -- causes the constructor to look for and use a file that caches a mapping of tty names to device numbers, and to create the file if it doesn't exist (this file is /tmp/TTYDEVS by default). This feature requires the Storable module. fields Returns a list of the field names supported by the module on the current architecture. table Reads the process table and returns a reference to an array of Proc::ProcessTable::Process objects. Attributes of a process object are returned by accessors named for the attribute; for example, to get the uid of a process just do: $process->uid The priority and pgrp methods also allow values to be set, since these are supported directly by internal perl functions. EXAMPLES
# A cheap and sleazy version of ps use Proc::ProcessTable; $FORMAT = "%-6s %-10s %-8s %-24s %s "; $t = new Proc::ProcessTable; printf($FORMAT, "PID", "TTY", "STAT", "START", "COMMAND"); foreach $p ( @{$t->table} ){ printf($FORMAT, $p->pid, $p->ttydev, $p->state, scalar(localtime($p->start)), $p->cmndline); } # Dump all the information in the current process table use Proc::ProcessTable; $t = new Proc::ProcessTable; foreach $p (@{$t->table}) { print "-------------------------------- "; foreach $f ($t->fields){ print $f, ": ", $p->{$f}, " "; } } CAVEATS
Please see the file README in the distribution for a list of supported operating systems. Please see the file PORTING for information on how to help make this work on your OS. AUTHOR
D. Urist, durist@frii.com SEE ALSO
Proc::ProcessTable::Process.pm, perl(1). perl v5.14.2 2013-02-10 ProcessTable(3pm)

Check Out this Related Man Page

SQL::Translator::Schema::Index(3pm)			User Contributed Perl Documentation		       SQL::Translator::Schema::Index(3pm)

NAME
SQL::Translator::Schema::Index - SQL::Translator index object SYNOPSIS
use SQL::Translator::Schema::Index; my $index = SQL::Translator::Schema::Index->new( name => 'foo', fields => [ id ], type => 'unique', ); DESCRIPTION
"SQL::Translator::Schema::Index" is the index object. Primary and unique keys are table constraints, not indices. METHODS
new Object constructor. my $schema = SQL::Translator::Schema::Index->new; fields Gets and set the fields the index is on. Accepts a string, list or arrayref; returns an array or array reference. Will unique the field names and keep them in order by the first occurrence of a field name. $index->fields('id'); $index->fields('id', 'name'); $index->fields( 'id, name' ); $index->fields( [ 'id', 'name' ] ); $index->fields( qw[ id name ] ); my @fields = $index->fields; is_valid Determine whether the index is valid or not. my $ok = $index->is_valid; name Get or set the index's name. my $name = $index->name('foo'); options Get or set the index's options (e.g., "using" or "where" for PG). Returns an array or array reference. my @options = $index->options; table Get or set the index's table object. my $table = $index->table; type Get or set the index's type. my $type = $index->type('unique'); Get or set the index's type. Currently there are only four acceptable types: UNIQUE, NORMAL, FULL_TEXT, and SPATIAL. The latter two might be MySQL-specific. While both lowercase and uppercase types are acceptable input, this method returns the type in uppercase. equals Determines if this index is the same as another my $isIdentical = $index1->equals( $index2 ); AUTHOR
Ken Youens-Clark <kclark@cpan.org>. perl v5.14.2 2012-01-18 SQL::Translator::Schema::Index(3pm)
Man Page