Bug#650518: (Fwd) Re: Bug#650518: libproc-processtable-perl: Module expects english locale
Salvatore Bonaccorso
carnil at debian.org
Sat Dec 17 14:07:00 UTC 2011
Hi Gregor and hi Wolfgang
On Fri, Dec 16, 2011 at 10:14:14PM +0100, gregor herrmann wrote:
> On Fri, 16 Dec 2011 21:05:59 +0000, Wolfgang Wilhelm wrote:
>
> > > $p->{pid} and $p->{cmndline} is probably cleaner.
> > Agreed. Is it cleaner in the perldoc part, too?
But I think this in the documentation because of this:
The elements of @{ $p->table } are Proc::ProcessTable *objects*, the
documentation to the table methods states:
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.
You see that e.g. by dumping with Data::Dumper:
---[ example ]---------------------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;
use Proc::ProcessTable;
use Data::Dumper;
my $p = Proc::ProcessTable->new();
foreach $ref ( @{ $p->table } ) {
print Dumper($ref);
}
-----------------------------------------------------------------------
Now the $ref's are process objects, hashrefs blessed into
Proc::ProcessTable objects. I think thus the notation in documentation
of Proc::ProcessTable makes sense this way.
Well okay you *can* access the keys of $ref via $ref->{uid}, as this
is a hashreference, blessed into Proc::ProcessTable.
Do you agree?
Regards
Salvatore
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-perl-maintainers/attachments/20111217/0402b894/attachment-0001.pgp>
More information about the pkg-perl-maintainers
mailing list