Hello Gregor,
> $p->{pid} and $p->{cmndline} is probably cleaner.
Agreed. Is it cleaner in the perldoc part, too?
> It seems we can close this bug :)
Duh! A brain bug...
Thanks
Wolfgang
________________________________
Von: gregor herrmann <[email protected]>
An: [email protected]; [email protected]
Gesendet: 21:43 Freitag, 16.Dezember 2011
Betreff: Bug#650518: (Fwd) Re: Bug#650518: libproc-processtable-perl: Module
expects english locale
tag 650518 - unreproducible moreinfo
thanks
On Fri, 16 Dec 2011 21:04:59 +0100, gregor herrmann wrote:
Hi Wolfgang,
please always keep [email protected] in the loop.
> So, first that what I started with:
Thanks for your info, I now can reproduce the problem:
> firma@nb000002:~$ uname -a
> Linux nb000002 2.6.32-5-amd64 #1 SMP Thu Nov 3 03:41:26 UTC 2011 x86_64
> GNU/Linux
> firma@nb000002:~$ echo $LANG
> de_DE.UTF-8
> firma@nb000002:~$ ls file_does_not_exist
> ls: Zugriff auf file_does_not_exist nicht möglich: Datei oder Verzeichnis
> nicht gefunden
> firma@nb000002:~$ perl -e 'use Proc::ProcessTable; printf
> "%s\n",$Proc::ProcessTable::VERSION;'
> 0.45
> firma@nb000002:~$ nl -ba ~/bin/ff
> 1 #!/usr/bin/env perl
> 2
> 3 use Proc::ProcessTable;
> 4 use strict;
> 5 use warnings;
> 6
> 7 my $p = Proc::ProcessTable->new();
> 8 my ( $ref, $pid, $cmd );
> 9
> 10 foreach $ref ( @{ $p->table } ) {
> 11 $pid = $p->pid;
> 12 $cmd = $p->cmdline;
> 13 if ( $cmd =~ /firefox/ ) {
> 14 printf( "Found %d / %s\n", $pid, $cmd );
> 15 }
> 16 }
> 17
>
> firma@nb000002:~$ ~/bin/ff
> Your vendor has not defined Proc::ProcessTable macro pid at
> /home/firma/bin/ff line 11
> firma@nb000002:~$
gregoa@belanna:~$ echo $LANG
C
gregoa@belanna:~$ export LANG=de_AT.utf8
gregoa@belanna:~$ echo $LANG
de_AT.utf8
gregoa@belanna:~$ ls file_does_not_exist
ls: Zugriff auf file_does_not_exist nicht möglich: Datei oder Verzeichnis nicht
gefunden
gregoa@belanna:~$ perl -e 'use Proc::ProcessTable; printf
"%s\n",$Proc::ProcessTable::VERSION;'
0.45
gregoa@belanna:~$ nl -ba ff
1 #!/usr/bin/env perl
2
3 use Proc::ProcessTable;
4 use strict;
5 use warnings;
6
7 my $p = Proc::ProcessTable->new();
8 my ( $ref, $pid, $cmd );
9
10 foreach $ref ( @{ $p->table } ) {
11 $pid = $p->pid;
12 $cmd = $p->cmdline;
13 if ( $cmd =~ /firefox/ ) {
14 printf( "Found %d / %s\n", $pid, $cmd );
15 }
16 }
gregoa@belanna:~$ perl ff
Your vendor has not defined Proc::ProcessTable macro pid at ff line 11
gregoa@belanna:~$ export LANG=C
gregoa@belanna:~$ echo $LANG
C
gregoa@belanna:~$ ls file_does_not_exist
ls: cannot access file_does_not_exist: No such file or directory
gregoa@belanna:~$ perl ff
Can't locate auto/Proc/ProcessTable/pid.al in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14
/usr/local/lib/site_perl .) at ff line 11
Interestingly the example script still works:
gregoa@belanna:~$ echo $LANG
C
gregoa@belanna:~$ /usr/share/doc/libproc-processtable-perl/examples/example.pl
[lots of output without errors]
gregoa@belanna:~$ export LANG=de_AT.utf8
gregoa@belanna:~$ echo $LANG
de_AT.utf8
gregoa@belanna:~$ /usr/share/doc/libproc-processtable-perl/examples/example.pl
[lots of output without errors]
Hm, so the example works both with C and de_AT.utf8, and your script
fails with both C and de_DE.UTF-8.
Some times later:
* It should be cmndline instead of cmdline.
* And then you want to use $ref and not $p in the loop.
* And $p->{pid} and $p->{cmndline} is probably cleaner.
The following works for me under C and under de_AT.utf8:
$ nl -ba ff
1 #!/usr/bin/env perl
2
3 use Proc::ProcessTable;
4 use strict;
5 use warnings;
6
7 my $p = Proc::ProcessTable->new();
8 my ( $ref, $pid, $cmd );
9
10 foreach $ref ( @{ $p->table } ) {
11 $pid = $ref->pid;
12 $cmd = $ref->cmndline;
13 if ( $cmd =~ /firefox/ ) {
14 printf( "Found %d / %s\n", $pid, $cmd );
15 }
16 }
It seems we can close this bug :)
Cheers,
gregor
--
.''`. Homepage: http://info.comodo.priv.at/ - OpenPGP key ID: 0x8649AA06
: :' : Debian GNU/Linux user, admin, & developer - http://www.debian.org/
`. `' Member of VIBE!AT & SPI, fellow of Free Software Foundation Europe
`- NP: Dire Straits: Sultans Of Swing